• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 "extensions/browser/extension_host_delegate.h"
9 
10 class AlloyBrowserHostImpl;
11 
12 namespace extensions {
13 
14 class CefExtensionHostDelegate : public ExtensionHostDelegate {
15  public:
16   explicit CefExtensionHostDelegate(AlloyBrowserHostImpl* browser);
17 
18   CefExtensionHostDelegate(const CefExtensionHostDelegate&) = delete;
19   CefExtensionHostDelegate& operator=(const CefExtensionHostDelegate&) = delete;
20 
21   ~CefExtensionHostDelegate() override;
22 
23   // ExtensionHostDelegate implementation.
24   void OnExtensionHostCreated(content::WebContents* web_contents) override;
25   void OnMainFrameCreatedForBackgroundPage(ExtensionHost* host) override;
26   content::JavaScriptDialogManager* GetJavaScriptDialogManager() override;
27   void CreateTab(std::unique_ptr<content::WebContents> web_contents,
28                  const std::string& extension_id,
29                  WindowOpenDisposition disposition,
30                  const gfx::Rect& initial_rect,
31                  bool user_gesture) override;
32   void ProcessMediaAccessRequest(content::WebContents* web_contents,
33                                  const content::MediaStreamRequest& request,
34                                  content::MediaResponseCallback callback,
35                                  const Extension* extension) override;
36   bool CheckMediaAccessPermission(content::RenderFrameHost* render_frame_host,
37                                   const GURL& security_origin,
38                                   blink::mojom::MediaStreamType type,
39                                   const Extension* extension) override;
40   content::PictureInPictureResult EnterPictureInPicture(
41       content::WebContents* web_contents,
42       const viz::SurfaceId& surface_id,
43       const gfx::Size& natural_size) override;
44   void ExitPictureInPicture() override;
45 };
46 
47 }  // namespace extensions
48 
49 #endif  // LIBCEF_BROWSER_EXTENSIONS_EXTENSION_HOST_DELEGATE_H_
50