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 // MediaStreamDeviceSettings is used to decide which of the available capture | 5 // MediaStreamDeviceSettings is used to decide which of the available capture |
6 // device to use as well as getting user permission to use the capture device. | 6 // device to use as well as getting user permission to use the capture device. |
7 // There will be one instance of MediaStreamDeviceSettings handling all | 7 // There will be one instance of MediaStreamDeviceSettings handling all |
8 // requests. | 8 // requests. |
9 | 9 |
10 // This version always accepts the first device in the list(s), but this will | |
11 // soon be changed to ask the user and/or Chrome settings. | |
12 | |
13 // Expected call flow: | 10 // Expected call flow: |
14 // 1. RequestCaptureDeviceUsage() to request usage of capture device. | 11 // 1. MediaStreamProvider::EnumrateDevices() is called to enumerate a list of |
mflodman_chromium_OOO
2012/04/27 14:39:17
I'd prefer to remove 1 since that is not done in t
| |
15 // 2. SettingsRequester::GetDevices() is called to get a list of available | 12 // available devices. |
16 // devices. | 13 // 2. RequestCaptureDeviceUsage() is called to create a new request for capture |
14 // device usage. | |
17 // 3. AvailableDevices() is called with a list of currently available devices. | 15 // 3. AvailableDevices() is called with a list of currently available devices. |
18 // 4. TODO(mflodman) Pick device and get user confirmation. | 16 // 4. Pick device and get user confirmation. |
19 // Temporary 4. Choose first device of each requested media type. | |
20 // 5. Confirm by calling SettingsRequester::DevicesAccepted(). | 17 // 5. Confirm by calling SettingsRequester::DevicesAccepted(). |
21 // Repeat step 1 - 5 for new device requests. | 18 // Repeat step 1 - 5 for new device requests. |
22 | 19 |
23 // Note that this is still in a development phase and the class will be modified | |
24 // to include real UI interaction. | |
25 | |
26 #ifndef CONTENT_BROWSER_RENDERER_HOST_MEDIA_MEDIA_STREAM_DEVICE_SETTINGS_H_ | 20 #ifndef CONTENT_BROWSER_RENDERER_HOST_MEDIA_MEDIA_STREAM_DEVICE_SETTINGS_H_ |
27 #define CONTENT_BROWSER_RENDERER_HOST_MEDIA_MEDIA_STREAM_DEVICE_SETTINGS_H_ | 21 #define CONTENT_BROWSER_RENDERER_HOST_MEDIA_MEDIA_STREAM_DEVICE_SETTINGS_H_ |
28 | 22 |
29 #include <map> | 23 #include <map> |
30 #include <string> | 24 #include <string> |
31 | 25 |
32 #include "base/basictypes.h" | 26 #include "base/basictypes.h" |
33 #include "base/memory/weak_ptr.h" | 27 #include "base/memory/weak_ptr.h" |
34 #include "content/browser/renderer_host/media/media_stream_provider.h" | 28 #include "content/browser/renderer_host/media/media_stream_provider.h" |
35 | 29 |
(...skipping 29 matching lines...) Expand all Loading... | |
65 // This method must be called on the IO thread. | 59 // This method must be called on the IO thread. |
66 void PostResponse(const std::string& label, | 60 void PostResponse(const std::string& label, |
67 const content::MediaStreamDevices& devices); | 61 const content::MediaStreamDevices& devices); |
68 | 62 |
69 // Used for testing only. This function is called to use faked UI, which is | 63 // Used for testing only. This function is called to use faked UI, which is |
70 // needed for server based tests. The first non-opened device(s) will be | 64 // needed for server based tests. The first non-opened device(s) will be |
71 // picked. | 65 // picked. |
72 void UseFakeUI(); | 66 void UseFakeUI(); |
73 | 67 |
74 private: | 68 private: |
75 typedef std::map< std::string, MediaStreamDeviceSettingsRequest* > | 69 typedef std::map<std::string, MediaStreamDeviceSettingsRequest*> |
76 SettingsRequests; | 70 SettingsRequests; |
77 | 71 |
78 SettingsRequester* requester_; | 72 SettingsRequester* requester_; |
79 SettingsRequests requests_; | 73 SettingsRequests requests_; |
80 | 74 |
81 // See comment above for method UseFakeUI. Used for automated testing. | 75 // See comment above for method UseFakeUI. Used for automated testing. |
82 bool use_fake_ui_; | 76 bool use_fake_ui_; |
83 | 77 |
84 DISALLOW_COPY_AND_ASSIGN(MediaStreamDeviceSettings); | 78 DISALLOW_COPY_AND_ASSIGN(MediaStreamDeviceSettings); |
85 }; | 79 }; |
86 | 80 |
87 } // namespace media_stream | 81 } // namespace media_stream |
88 | 82 |
89 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_MEDIA_STREAM_DEVICE_SETTINGS_H_ | 83 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_MEDIA_STREAM_DEVICE_SETTINGS_H_ |
OLD | NEW |