| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_WEBRTC_MEDIA_STREAM_DEVICES_CONTROLLER_H_ | 5 #ifndef CHROME_BROWSER_MEDIA_WEBRTC_MEDIA_STREAM_DEVICES_CONTROLLER_H_ |
| 6 #define CHROME_BROWSER_MEDIA_WEBRTC_MEDIA_STREAM_DEVICES_CONTROLLER_H_ | 6 #define CHROME_BROWSER_MEDIA_WEBRTC_MEDIA_STREAM_DEVICES_CONTROLLER_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 virtual void ShowPrompt( | 40 virtual void ShowPrompt( |
| 41 bool user_gesture, | 41 bool user_gesture, |
| 42 content::WebContents* web_contents, | 42 content::WebContents* web_contents, |
| 43 std::unique_ptr<MediaStreamDevicesController> controller) = 0; | 43 std::unique_ptr<MediaStreamDevicesController> controller) = 0; |
| 44 }; | 44 }; |
| 45 } | 45 } |
| 46 | 46 |
| 47 class MediaStreamDevicesController : public PermissionRequest { | 47 class MediaStreamDevicesController : public PermissionRequest { |
| 48 public: | 48 public: |
| 49 static void RequestPermissions( | 49 static void RequestPermissions( |
| 50 content::WebContents* web_contents, | |
| 51 const content::MediaStreamRequest& request, | 50 const content::MediaStreamRequest& request, |
| 52 const content::MediaResponseCallback& callback); | 51 const content::MediaResponseCallback& callback); |
| 53 | 52 |
| 54 // Registers the prefs backing the audio and video policies. | 53 // Registers the prefs backing the audio and video policies. |
| 55 static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry); | 54 static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry); |
| 56 | 55 |
| 57 ~MediaStreamDevicesController() override; | 56 ~MediaStreamDevicesController() override; |
| 58 | 57 |
| 59 bool IsAskingForAudio() const; | 58 bool IsAskingForAudio() const; |
| 60 bool IsAskingForVideo() const; | 59 bool IsAskingForVideo() const; |
| (...skipping 22 matching lines...) Expand all Loading... |
| 83 | 82 |
| 84 private: | 83 private: |
| 85 friend class MediaStreamDevicesControllerTest; | 84 friend class MediaStreamDevicesControllerTest; |
| 86 friend class test::MediaStreamDevicesControllerTestApi; | 85 friend class test::MediaStreamDevicesControllerTestApi; |
| 87 friend class policy::MediaStreamDevicesControllerBrowserTest; | 86 friend class policy::MediaStreamDevicesControllerBrowserTest; |
| 88 | 87 |
| 89 class MediaPermissionStatus; | 88 class MediaPermissionStatus; |
| 90 class PermissionPromptDelegateImpl; | 89 class PermissionPromptDelegateImpl; |
| 91 | 90 |
| 92 static void RequestPermissionsWithDelegate( | 91 static void RequestPermissionsWithDelegate( |
| 93 content::WebContents* web_contents, | |
| 94 const content::MediaStreamRequest& request, | 92 const content::MediaStreamRequest& request, |
| 95 const content::MediaResponseCallback& callback, | 93 const content::MediaResponseCallback& callback, |
| 96 internal::PermissionPromptDelegate* delegate); | 94 internal::PermissionPromptDelegate* delegate); |
| 97 | 95 |
| 98 MediaStreamDevicesController(content::WebContents* web_contents, | 96 MediaStreamDevicesController(content::WebContents* web_contents, |
| 99 const content::MediaStreamRequest& request, | 97 const content::MediaStreamRequest& request, |
| 100 const content::MediaResponseCallback& callback, | 98 const content::MediaResponseCallback& callback, |
| 101 const MediaPermissionStatus& initial_permission); | 99 const MediaPermissionStatus& initial_permission); |
| 102 | 100 |
| 103 bool IsAllowedForAudio() const; | 101 bool IsAllowedForAudio() const; |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 // The callback that needs to be Run to notify WebRTC of whether access to | 165 // The callback that needs to be Run to notify WebRTC of whether access to |
| 168 // audio/video devices was granted or not. | 166 // audio/video devices was granted or not. |
| 169 content::MediaResponseCallback callback_; | 167 content::MediaResponseCallback callback_; |
| 170 | 168 |
| 171 std::unique_ptr<internal::PermissionPromptDelegate> delegate_; | 169 std::unique_ptr<internal::PermissionPromptDelegate> delegate_; |
| 172 | 170 |
| 173 DISALLOW_COPY_AND_ASSIGN(MediaStreamDevicesController); | 171 DISALLOW_COPY_AND_ASSIGN(MediaStreamDevicesController); |
| 174 }; | 172 }; |
| 175 | 173 |
| 176 #endif // CHROME_BROWSER_MEDIA_WEBRTC_MEDIA_STREAM_DEVICES_CONTROLLER_H_ | 174 #endif // CHROME_BROWSER_MEDIA_WEBRTC_MEDIA_STREAM_DEVICES_CONTROLLER_H_ |
| OLD | NEW |