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 #include "chrome/browser/ui/webui/settings/settings_media_devices_selection_hand
ler.h" | 5 #include "chrome/browser/ui/webui/settings/settings_media_devices_selection_hand
ler.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <memory> | 9 #include <memory> |
10 #include <utility> | 10 #include <utility> |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 device_list.Append(std::move(entry)); | 130 device_list.Append(std::move(entry)); |
131 if (devices[i].id == default_device) | 131 if (devices[i].id == default_device) |
132 default_id = default_device; | 132 default_id = default_device; |
133 } | 133 } |
134 | 134 |
135 // Use the first device as the default device if the preferred default device | 135 // Use the first device as the default device if the preferred default device |
136 // does not exist in the OS. | 136 // does not exist in the OS. |
137 if (!devices.empty() && default_id.empty()) | 137 if (!devices.empty() && default_id.empty()) |
138 default_id = devices[0].id; | 138 default_id = devices[0].id; |
139 | 139 |
140 base::StringValue default_value(default_id); | 140 base::Value default_value(default_id); |
141 base::StringValue type_value(device_type); | 141 base::Value type_value(device_type); |
142 CallJavascriptFunction("cr.webUIListenerCallback", | 142 CallJavascriptFunction("cr.webUIListenerCallback", |
143 base::StringValue("updateDevicesMenu"), | 143 base::Value("updateDevicesMenu"), type_value, |
144 type_value, | 144 device_list, default_value); |
145 device_list, | |
146 default_value); | |
147 } | 145 } |
148 | 146 |
149 std::string MediaDevicesSelectionHandler::GetDeviceDisplayName( | 147 std::string MediaDevicesSelectionHandler::GetDeviceDisplayName( |
150 const content::MediaStreamDevice& device) const { | 148 const content::MediaStreamDevice& device) const { |
151 std::string facing_info; | 149 std::string facing_info; |
152 | 150 |
153 #if BUILDFLAG(ENABLE_EXTENSIONS) | 151 #if BUILDFLAG(ENABLE_EXTENSIONS) |
154 switch (device.video_facing) { | 152 switch (device.video_facing) { |
155 case media::VideoFacingMode::MEDIA_VIDEO_FACING_USER: | 153 case media::VideoFacingMode::MEDIA_VIDEO_FACING_USER: |
156 facing_info = l10n_util::GetStringUTF8(IDS_CAMERA_FACING_USER); | 154 facing_info = l10n_util::GetStringUTF8(IDS_CAMERA_FACING_USER); |
(...skipping 24 matching lines...) Expand all Loading... |
181 case VIDEO: | 179 case VIDEO: |
182 devices = MediaCaptureDevicesDispatcher::GetInstance()-> | 180 devices = MediaCaptureDevicesDispatcher::GetInstance()-> |
183 GetVideoCaptureDevices(); | 181 GetVideoCaptureDevices(); |
184 break; | 182 break; |
185 } | 183 } |
186 | 184 |
187 UpdateDevicesMenu(type, devices); | 185 UpdateDevicesMenu(type, devices); |
188 } | 186 } |
189 | 187 |
190 } // namespace settings | 188 } // namespace settings |
OLD | NEW |