| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 CHROME_BROWSER_MEDIA_PUBLIC_SESSION_MEDIA_ACCESS_HANDLER_H_ | 5 #ifndef CHROME_BROWSER_MEDIA_PUBLIC_SESSION_MEDIA_ACCESS_HANDLER_H_ |
| 6 #define CHROME_BROWSER_MEDIA_PUBLIC_SESSION_MEDIA_ACCESS_HANDLER_H_ | 6 #define CHROME_BROWSER_MEDIA_PUBLIC_SESSION_MEDIA_ACCESS_HANDLER_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "chrome/browser/extensions/extension_install_prompt.h" | 9 #include "chrome/browser/extensions/extension_install_prompt.h" |
| 10 #include "chrome/browser/media/extension_media_access_handler.h" | 10 #include "chrome/browser/media/extension_media_access_handler.h" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 // uses the capture APIs for the first time, we show the user a dialog where | 24 // uses the capture APIs for the first time, we show the user a dialog where |
| 25 // they can choose whether to allow the extension access to camera and/or | 25 // they can choose whether to allow the extension access to camera and/or |
| 26 // microphone. Note: camera and microphone are used through audioCapture and | 26 // microphone. Note: camera and microphone are used through audioCapture and |
| 27 // videoCapture manifest permissions which are limited to platform apps only. | 27 // videoCapture manifest permissions which are limited to platform apps only. |
| 28 class PublicSessionMediaAccessHandler : public MediaAccessHandler { | 28 class PublicSessionMediaAccessHandler : public MediaAccessHandler { |
| 29 public: | 29 public: |
| 30 PublicSessionMediaAccessHandler(); | 30 PublicSessionMediaAccessHandler(); |
| 31 ~PublicSessionMediaAccessHandler() override; | 31 ~PublicSessionMediaAccessHandler() override; |
| 32 | 32 |
| 33 // MediaAccessHandler implementation. | 33 // MediaAccessHandler implementation. |
| 34 bool SupportsStreamType(const content::MediaStreamType type, | 34 bool SupportsStreamType(content::WebContents* web_contents, |
| 35 const content::MediaStreamType type, |
| 35 const extensions::Extension* extension) override; | 36 const extensions::Extension* extension) override; |
| 36 bool CheckMediaAccessPermission( | 37 bool CheckMediaAccessPermission( |
| 37 content::WebContents* web_contents, | 38 content::WebContents* web_contents, |
| 38 const GURL& security_origin, | 39 const GURL& security_origin, |
| 39 content::MediaStreamType type, | 40 content::MediaStreamType type, |
| 40 const extensions::Extension* extension) override; | 41 const extensions::Extension* extension) override; |
| 41 void HandleRequest(content::WebContents* web_contents, | 42 void HandleRequest(content::WebContents* web_contents, |
| 42 const content::MediaStreamRequest& request, | 43 const content::MediaStreamRequest& request, |
| 43 const content::MediaResponseCallback& callback, | 44 const content::MediaResponseCallback& callback, |
| 44 const extensions::Extension* extension) override; | 45 const extensions::Extension* extension) override; |
| 45 | 46 |
| 46 private: | 47 private: |
| 47 // Helper function used to chain the HandleRequest call into the original | 48 // Helper function used to chain the HandleRequest call into the original |
| 48 // inside of ExtensionMediaAccessHandler. | 49 // inside of ExtensionMediaAccessHandler. |
| 49 void ChainHandleRequest( | 50 void ChainHandleRequest( |
| 50 content::WebContents* web_contents, | 51 content::WebContents* web_contents, |
| 51 const content::MediaStreamRequest& request, | 52 const content::MediaStreamRequest& request, |
| 52 const content::MediaResponseCallback& callback, | 53 const content::MediaResponseCallback& callback, |
| 53 const extensions::Extension* extension, | 54 const extensions::Extension* extension, |
| 54 const extensions::PermissionIDSet& allowed_permissions); | 55 const extensions::PermissionIDSet& allowed_permissions); |
| 55 | 56 |
| 56 ExtensionMediaAccessHandler extension_media_access_handler_; | 57 ExtensionMediaAccessHandler extension_media_access_handler_; |
| 57 | 58 |
| 58 DISALLOW_COPY_AND_ASSIGN(PublicSessionMediaAccessHandler); | 59 DISALLOW_COPY_AND_ASSIGN(PublicSessionMediaAccessHandler); |
| 59 }; | 60 }; |
| 60 | 61 |
| 61 #endif // CHROME_BROWSER_MEDIA_PUBLIC_SESSION_MEDIA_ACCESS_HANDLER_H_ | 62 #endif // CHROME_BROWSER_MEDIA_PUBLIC_SESSION_MEDIA_ACCESS_HANDLER_H_ |
| OLD | NEW |