1 // Copyright 2015 The Chromium Embedded Framework Authors. 2 // Portions copyright 2014 The Chromium Authors. All rights reserved. 3 // Use of this source code is governed by a BSD-style license that can be 4 // found in the LICENSE file. 5 6 #ifndef CEF_LIBCEF_BROWSER_EXTENSIONS_MIME_HANDLER_VIEW_GUEST_DELEGATE_H_ 7 #define CEF_LIBCEF_BROWSER_EXTENSIONS_MIME_HANDLER_VIEW_GUEST_DELEGATE_H_ 8 9 #include "extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.h" 10 #include "extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest_delegate.h" 11 12 namespace content { 13 struct ContextMenuParams; 14 } 15 16 namespace extensions { 17 18 class CefMimeHandlerViewGuestDelegate : public MimeHandlerViewGuestDelegate { 19 public: 20 explicit CefMimeHandlerViewGuestDelegate(MimeHandlerViewGuest* guest); 21 22 CefMimeHandlerViewGuestDelegate(const CefMimeHandlerViewGuestDelegate&) = 23 delete; 24 CefMimeHandlerViewGuestDelegate& operator=( 25 const CefMimeHandlerViewGuestDelegate&) = delete; 26 27 ~CefMimeHandlerViewGuestDelegate() override; 28 29 // MimeHandlerViewGuestDelegate methods. 30 void OverrideWebContentsCreateParams( 31 content::WebContents::CreateParams* params) override; 32 void OnGuestAttached() override; 33 void OnGuestDetached() override; 34 bool HandleContextMenu(content::RenderFrameHost& render_frame_host, 35 const content::ContextMenuParams& params) override; 36 37 private: 38 MimeHandlerViewGuest* guest_; // Owns us. 39 content::WebContents* owner_web_contents_; 40 }; 41 42 } // namespace extensions 43 44 #endif // CEF_LIBCEF_BROWSER_EXTENSIONS_MIME_HANDLER_VIEW_GUEST_DELEGATE_H_ 45