1 // Copyright 2017 the Chromium Embedded Framework Authors. Portions copyright 2 // 2014 The Chromium Authors. All rights reserved. Use of this source code is 3 // governed by a BSD-style license that can be found in the LICENSE file. 4 5 #ifndef LIBCEF_BROWSER_EXTENSIONS_EXTENSION_HOST_DELEGATE_H_ 6 #define LIBCEF_BROWSER_EXTENSIONS_EXTENSION_HOST_DELEGATE_H_ 7 8 #include "base/macros.h" 9 #include "extensions/browser/extension_host_delegate.h" 10 11 class AlloyBrowserHostImpl; 12 13 namespace extensions { 14 15 class CefExtensionHostDelegate : public ExtensionHostDelegate { 16 public: 17 explicit CefExtensionHostDelegate(AlloyBrowserHostImpl* browser); 18 ~CefExtensionHostDelegate() override; 19 20 // ExtensionHostDelegate implementation. 21 void OnExtensionHostCreated(content::WebContents* web_contents) override; 22 void OnMainFrameCreatedForBackgroundPage(ExtensionHost* host) override; 23 content::JavaScriptDialogManager* GetJavaScriptDialogManager() override; 24 void CreateTab(std::unique_ptr<content::WebContents> web_contents, 25 const std::string& extension_id, 26 WindowOpenDisposition disposition, 27 const gfx::Rect& initial_rect, 28 bool user_gesture) override; 29 void ProcessMediaAccessRequest(content::WebContents* web_contents, 30 const content::MediaStreamRequest& request, 31 content::MediaResponseCallback callback, 32 const Extension* extension) override; 33 bool CheckMediaAccessPermission(content::RenderFrameHost* render_frame_host, 34 const GURL& security_origin, 35 blink::mojom::MediaStreamType type, 36 const Extension* extension) override; 37 content::PictureInPictureResult EnterPictureInPicture( 38 content::WebContents* web_contents, 39 const viz::SurfaceId& surface_id, 40 const gfx::Size& natural_size) override; 41 void ExitPictureInPicture() override; 42 43 private: 44 DISALLOW_COPY_AND_ASSIGN(CefExtensionHostDelegate); 45 }; 46 47 } // namespace extensions 48 49 #endif // LIBCEF_BROWSER_EXTENSIONS_EXTENSION_HOST_DELEGATE_H_ 50