electron_extension_host_delegate.h 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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 ELECTRON_SHELL_BROWSER_EXTENSIONS_ELECTRON_EXTENSION_HOST_DELEGATE_H_
  5. #define ELECTRON_SHELL_BROWSER_EXTENSIONS_ELECTRON_EXTENSION_HOST_DELEGATE_H_
  6. #include <memory>
  7. #include <string>
  8. #include "extensions/browser/extension_host_delegate.h"
  9. namespace extensions {
  10. // A minimal ExtensionHostDelegate.
  11. class ElectronExtensionHostDelegate : public ExtensionHostDelegate {
  12. public:
  13. ElectronExtensionHostDelegate();
  14. ~ElectronExtensionHostDelegate() override;
  15. // disable copy
  16. ElectronExtensionHostDelegate(const ElectronExtensionHostDelegate&) = delete;
  17. ElectronExtensionHostDelegate& operator=(
  18. const ElectronExtensionHostDelegate&) = delete;
  19. // ExtensionHostDelegate implementation.
  20. void OnExtensionHostCreated(content::WebContents* web_contents) override;
  21. void OnMainFrameCreatedForBackgroundPage(ExtensionHost* host) override {}
  22. content::JavaScriptDialogManager* GetJavaScriptDialogManager() override;
  23. void CreateTab(std::unique_ptr<content::WebContents> web_contents,
  24. const std::string& extension_id,
  25. WindowOpenDisposition disposition,
  26. const blink::mojom::WindowFeatures& window_features,
  27. bool user_gesture) override;
  28. void ProcessMediaAccessRequest(content::WebContents* web_contents,
  29. const content::MediaStreamRequest& request,
  30. content::MediaResponseCallback callback,
  31. const Extension* extension) override;
  32. bool CheckMediaAccessPermission(content::RenderFrameHost* render_frame_host,
  33. const url::Origin& security_origin,
  34. blink::mojom::MediaStreamType type,
  35. const Extension* extension) override;
  36. content::PictureInPictureResult EnterPictureInPicture(
  37. content::WebContents* web_contents) override;
  38. void ExitPictureInPicture() override;
  39. };
  40. } // namespace extensions
  41. #endif // ELECTRON_SHELL_BROWSER_EXTENSIONS_ELECTRON_EXTENSION_HOST_DELEGATE_H_