| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef EXTENSIONS_BROWSER_EXTENSION_HOST_DELEGATE_H_ | 5 #ifndef EXTENSIONS_BROWSER_EXTENSION_HOST_DELEGATE_H_ |
| 6 #define EXTENSIONS_BROWSER_EXTENSION_HOST_DELEGATE_H_ | 6 #define EXTENSIONS_BROWSER_EXTENSION_HOST_DELEGATE_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "content/public/common/media_stream_request.h" | 10 #include "content/public/common/media_stream_request.h" |
| 11 #include "ui/base/window_open_disposition.h" | 11 #include "ui/base/window_open_disposition.h" |
| 12 | 12 |
| 13 namespace content { | 13 namespace content { |
| 14 class JavaScriptDialogManager; | 14 class JavaScriptDialogManager; |
| 15 class WebContents; | 15 class WebContents; |
| 16 } | 16 } |
| 17 | 17 |
| 18 namespace gfx { | 18 namespace gfx { |
| 19 class Rect; | 19 class Rect; |
| 20 } | 20 } |
| 21 | 21 |
| 22 namespace extensions { | 22 namespace extensions { |
| 23 class Extension; | 23 class Extension; |
| 24 class ExtensionHost; | 24 class ExtensionHost; |
| 25 class ExtensionHostQueue; |
| 25 | 26 |
| 26 // A delegate to support functionality that cannot exist in the extensions | 27 // A delegate to support functionality that cannot exist in the extensions |
| 27 // module. This is not an inner class of ExtensionHost to allow it to be forward | 28 // module. This is not an inner class of ExtensionHost to allow it to be forward |
| 28 // declared. | 29 // declared. |
| 29 class ExtensionHostDelegate { | 30 class ExtensionHostDelegate { |
| 30 public: | 31 public: |
| 31 virtual ~ExtensionHostDelegate() {} | 32 virtual ~ExtensionHostDelegate() {} |
| 32 | 33 |
| 33 // Called after the hosting |web_contents| for an extension is created. The | 34 // Called after the hosting |web_contents| for an extension is created. The |
| 34 // implementation may wish to add preference observers to |web_contents|. | 35 // implementation may wish to add preference observers to |web_contents|. |
| (...skipping 22 matching lines...) Expand all Loading... |
| 57 const content::MediaResponseCallback& callback, | 58 const content::MediaResponseCallback& callback, |
| 58 const Extension* extension) = 0; | 59 const Extension* extension) = 0; |
| 59 | 60 |
| 60 // Checks if we have permission to access the microphone or camera. Note that | 61 // Checks if we have permission to access the microphone or camera. Note that |
| 61 // this does not query the user. |type| must be MEDIA_DEVICE_AUDIO_CAPTURE | 62 // this does not query the user. |type| must be MEDIA_DEVICE_AUDIO_CAPTURE |
| 62 // or MEDIA_DEVICE_VIDEO_CAPTURE. | 63 // or MEDIA_DEVICE_VIDEO_CAPTURE. |
| 63 virtual bool CheckMediaAccessPermission(content::WebContents* web_contents, | 64 virtual bool CheckMediaAccessPermission(content::WebContents* web_contents, |
| 64 const GURL& security_origin, | 65 const GURL& security_origin, |
| 65 content::MediaStreamType type, | 66 content::MediaStreamType type, |
| 66 const Extension* extension) = 0; | 67 const Extension* extension) = 0; |
| 68 |
| 69 // Returns the ExtensionHostQueue implementation to use for creating |
| 70 // ExtensionHost renderers. |
| 71 virtual ExtensionHostQueue* GetExtensionHostQueue() const = 0; |
| 67 }; | 72 }; |
| 68 | 73 |
| 69 } // namespace extensions | 74 } // namespace extensions |
| 70 | 75 |
| 71 #endif // EXTENSIONS_BROWSER_EXTENSION_HOST_DELEGATE_H_ | 76 #endif // EXTENSIONS_BROWSER_EXTENSION_HOST_DELEGATE_H_ |
| OLD | NEW |