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 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 // This class is only needed interally and for tests. It can be removed once | 84 // This class is only needed interally and for tests. It can be removed once |
85 // crbug.com/606138 is fixed. Delegate for showing permission prompts. It's | 85 // crbug.com/606138 is fixed. Delegate for showing permission prompts. It's |
86 // only public because subclassing from a friend class doesn't work in gcc | 86 // only public because subclassing from a friend class doesn't work in gcc |
87 // (see https://codereview.chromium.org/2768923003). | 87 // (see https://codereview.chromium.org/2768923003). |
88 class PermissionPromptDelegate { | 88 class PermissionPromptDelegate { |
89 public: | 89 public: |
90 virtual void ShowPrompt( | 90 virtual void ShowPrompt( |
91 bool user_gesture, | 91 bool user_gesture, |
92 content::WebContents* web_contents, | 92 content::WebContents* web_contents, |
93 std::unique_ptr<MediaStreamDevicesController::Request> request) = 0; | 93 std::unique_ptr<MediaStreamDevicesController::Request> request) = 0; |
| 94 virtual ~PermissionPromptDelegate() {} |
94 }; | 95 }; |
95 | 96 |
96 static void RequestPermissions( | 97 static void RequestPermissions( |
97 const content::MediaStreamRequest& request, | 98 const content::MediaStreamRequest& request, |
98 const content::MediaResponseCallback& callback); | 99 const content::MediaResponseCallback& callback); |
99 | 100 |
100 // Registers the prefs backing the audio and video policies. | 101 // Registers the prefs backing the audio and video policies. |
101 static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry); | 102 static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry); |
102 | 103 |
103 ~MediaStreamDevicesController(); | 104 ~MediaStreamDevicesController(); |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
183 // The callback that needs to be Run to notify WebRTC of whether access to | 184 // The callback that needs to be Run to notify WebRTC of whether access to |
184 // audio/video devices was granted or not. | 185 // audio/video devices was granted or not. |
185 content::MediaResponseCallback callback_; | 186 content::MediaResponseCallback callback_; |
186 | 187 |
187 std::unique_ptr<PermissionPromptDelegate> delegate_; | 188 std::unique_ptr<PermissionPromptDelegate> delegate_; |
188 | 189 |
189 DISALLOW_COPY_AND_ASSIGN(MediaStreamDevicesController); | 190 DISALLOW_COPY_AND_ASSIGN(MediaStreamDevicesController); |
190 }; | 191 }; |
191 | 192 |
192 #endif // CHROME_BROWSER_MEDIA_WEBRTC_MEDIA_STREAM_DEVICES_CONTROLLER_H_ | 193 #endif // CHROME_BROWSER_MEDIA_WEBRTC_MEDIA_STREAM_DEVICES_CONTROLLER_H_ |
OLD | NEW |