shell_extension_host_delegate.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. // Copyright 2014 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #ifndef EXTENSIONS_SHELL_BROWSER_SHELL_EXTENSION_HOST_DELEGATE_H_
  5. #define EXTENSIONS_SHELL_BROWSER_SHELL_EXTENSION_HOST_DELEGATE_H_
  6. #include "extensions/browser/extension_host_delegate.h"
  7. namespace extensions {
  8. // A minimal ExtensionHostDelegate.
  9. class ShellExtensionHostDelegate : public ExtensionHostDelegate {
  10. public:
  11. ShellExtensionHostDelegate();
  12. ShellExtensionHostDelegate(const ShellExtensionHostDelegate&) = delete;
  13. ShellExtensionHostDelegate& operator=(const ShellExtensionHostDelegate&) =
  14. delete;
  15. ~ShellExtensionHostDelegate() override;
  16. // ExtensionHostDelegate implementation.
  17. void OnExtensionHostCreated(content::WebContents* web_contents) override;
  18. void OnMainFrameCreatedForBackgroundPage(ExtensionHost* host) override;
  19. content::JavaScriptDialogManager* GetJavaScriptDialogManager() override;
  20. void CreateTab(std::unique_ptr<content::WebContents> web_contents,
  21. const std::string& extension_id,
  22. WindowOpenDisposition disposition,
  23. const gfx::Rect& initial_rect,
  24. bool user_gesture) override;
  25. void ProcessMediaAccessRequest(content::WebContents* web_contents,
  26. const content::MediaStreamRequest& request,
  27. content::MediaResponseCallback callback,
  28. const Extension* extension) override;
  29. bool CheckMediaAccessPermission(content::RenderFrameHost* render_frame_host,
  30. const GURL& security_origin,
  31. blink::mojom::MediaStreamType type,
  32. const Extension* extension) override;
  33. content::PictureInPictureResult EnterPictureInPicture(
  34. content::WebContents* web_contents) override;
  35. void ExitPictureInPicture() override;
  36. };
  37. } // namespace extensions
  38. #endif // EXTENSIONS_SHELL_BROWSER_SHELL_EXTENSION_HOST_DELEGATE_H_