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 #include "content/renderer/media/user_media_client_impl.h" | 5 #include "content/renderer/media/user_media_client_impl.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <utility> | 10 #include <utility> |
(...skipping 27 matching lines...) Expand all Loading... |
38 #include "third_party/WebKit/public/platform/WebString.h" | 38 #include "third_party/WebKit/public/platform/WebString.h" |
39 #include "third_party/WebKit/public/web/WebDocument.h" | 39 #include "third_party/WebKit/public/web/WebDocument.h" |
40 #include "third_party/WebKit/public/web/WebLocalFrame.h" | 40 #include "third_party/WebKit/public/web/WebLocalFrame.h" |
41 #include "third_party/WebKit/public/web/WebUserGestureIndicator.h" | 41 #include "third_party/WebKit/public/web/WebUserGestureIndicator.h" |
42 | 42 |
43 namespace content { | 43 namespace content { |
44 namespace { | 44 namespace { |
45 | 45 |
46 void CopyFirstString(const blink::StringConstraint& constraint, | 46 void CopyFirstString(const blink::StringConstraint& constraint, |
47 std::string* destination) { | 47 std::string* destination) { |
48 if (!constraint.exact().isEmpty()) | 48 if (!constraint.exact().empty()) |
49 *destination = constraint.exact()[0].utf8(); | 49 *destination = constraint.exact()[0].utf8(); |
50 } | 50 } |
51 | 51 |
52 bool FindDeviceId(const blink::WebVector<blink::WebString> candidates, | 52 bool FindDeviceId(const blink::WebVector<blink::WebString> candidates, |
53 const MediaDeviceInfoArray& device_infos, | 53 const MediaDeviceInfoArray& device_infos, |
54 std::string* device_id) { | 54 std::string* device_id) { |
55 for (const auto& candidate : candidates) { | 55 for (const auto& candidate : candidates) { |
56 auto it = std::find_if(device_infos.begin(), device_infos.end(), | 56 auto it = std::find_if(device_infos.begin(), device_infos.end(), |
57 [&candidate](const MediaDeviceInfo& info) { | 57 [&candidate](const MediaDeviceInfo& info) { |
58 return info.device_id == candidate.utf8(); | 58 return info.device_id == candidate.utf8(); |
(...skipping 1302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1361 const blink::WebString& result_name) { | 1361 const blink::WebString& result_name) { |
1362 // Check if we're waiting to be notified of this source. If not, then we'll | 1362 // Check if we're waiting to be notified of this source. If not, then we'll |
1363 // ignore the notification. | 1363 // ignore the notification. |
1364 auto found = std::find(sources_waiting_for_callback_.begin(), | 1364 auto found = std::find(sources_waiting_for_callback_.begin(), |
1365 sources_waiting_for_callback_.end(), source); | 1365 sources_waiting_for_callback_.end(), source); |
1366 if (found != sources_waiting_for_callback_.end()) | 1366 if (found != sources_waiting_for_callback_.end()) |
1367 OnTrackStarted(source, result, result_name); | 1367 OnTrackStarted(source, result, result_name); |
1368 } | 1368 } |
1369 | 1369 |
1370 } // namespace content | 1370 } // namespace content |
OLD | NEW |