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 10 matching lines...) Expand all Loading... |
21 } | 21 } |
22 | 22 |
23 namespace user_prefs { | 23 namespace user_prefs { |
24 class PrefRegistrySyncable; | 24 class PrefRegistrySyncable; |
25 } | 25 } |
26 | 26 |
27 namespace policy { | 27 namespace policy { |
28 class MediaStreamDevicesControllerBrowserTest; | 28 class MediaStreamDevicesControllerBrowserTest; |
29 } | 29 } |
30 | 30 |
| 31 namespace test { |
| 32 class MediaStreamDevicesControllerTestApi; |
| 33 } |
| 34 |
31 class MediaStreamDevicesController : public PermissionRequest { | 35 class MediaStreamDevicesController : public PermissionRequest { |
32 public: | 36 public: |
33 static void RequestPermissions( | 37 static void RequestPermissions( |
34 content::WebContents* web_contents, | 38 content::WebContents* web_contents, |
35 const content::MediaStreamRequest& request, | 39 const content::MediaStreamRequest& request, |
36 const content::MediaResponseCallback& callback); | 40 const content::MediaResponseCallback& callback); |
37 | 41 |
38 // Registers the prefs backing the audio and video policies. | 42 // Registers the prefs backing the audio and video policies. |
39 static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry); | 43 static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry); |
40 | 44 |
(...skipping 19 matching lines...) Expand all Loading... |
60 base::string16 GetMessageTextFragment() const override; | 64 base::string16 GetMessageTextFragment() const override; |
61 GURL GetOrigin() const override; | 65 GURL GetOrigin() const override; |
62 void PermissionGranted() override; | 66 void PermissionGranted() override; |
63 void PermissionDenied() override; | 67 void PermissionDenied() override; |
64 void Cancelled() override; | 68 void Cancelled() override; |
65 void RequestFinished() override; | 69 void RequestFinished() override; |
66 PermissionRequestType GetPermissionRequestType() const override; | 70 PermissionRequestType GetPermissionRequestType() const override; |
67 | 71 |
68 private: | 72 private: |
69 friend class MediaStreamDevicesControllerTest; | 73 friend class MediaStreamDevicesControllerTest; |
| 74 friend class test::MediaStreamDevicesControllerTestApi; |
70 friend class policy::MediaStreamDevicesControllerBrowserTest; | 75 friend class policy::MediaStreamDevicesControllerBrowserTest; |
71 | 76 |
72 // Delegate showing permission prompts. | 77 // Delegate showing permission prompts. |
73 class PermissionPromptDelegate { | 78 class PermissionPromptDelegate { |
74 public: | 79 public: |
75 virtual void ShowPrompt( | 80 virtual void ShowPrompt( |
76 bool user_gesture, | 81 bool user_gesture, |
77 content::WebContents* web_contents, | 82 content::WebContents* web_contents, |
78 std::unique_ptr<MediaStreamDevicesController> controller) = 0; | 83 std::unique_ptr<MediaStreamDevicesController> controller) = 0; |
79 }; | 84 }; |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 // The callback that needs to be Run to notify WebRTC of whether access to | 164 // The callback that needs to be Run to notify WebRTC of whether access to |
160 // audio/video devices was granted or not. | 165 // audio/video devices was granted or not. |
161 content::MediaResponseCallback callback_; | 166 content::MediaResponseCallback callback_; |
162 | 167 |
163 std::unique_ptr<PermissionPromptDelegate> delegate_; | 168 std::unique_ptr<PermissionPromptDelegate> delegate_; |
164 | 169 |
165 DISALLOW_COPY_AND_ASSIGN(MediaStreamDevicesController); | 170 DISALLOW_COPY_AND_ASSIGN(MediaStreamDevicesController); |
166 }; | 171 }; |
167 | 172 |
168 #endif // CHROME_BROWSER_MEDIA_WEBRTC_MEDIA_STREAM_DEVICES_CONTROLLER_H_ | 173 #endif // CHROME_BROWSER_MEDIA_WEBRTC_MEDIA_STREAM_DEVICES_CONTROLLER_H_ |
OLD | NEW |