OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/devtools/device/tcp_device_provider.h" | 5 #include "chrome/browser/devtools/device/tcp_device_provider.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/location.h" | 9 #include "base/location.h" |
10 #include "base/single_thread_task_runner.h" | 10 #include "base/single_thread_task_runner.h" |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 } | 75 } |
76 | 76 |
77 TCPDeviceProvider::TCPDeviceProvider(const HostPortSet& targets) | 77 TCPDeviceProvider::TCPDeviceProvider(const HostPortSet& targets) |
78 : targets_(targets) { | 78 : targets_(targets) { |
79 } | 79 } |
80 | 80 |
81 void TCPDeviceProvider::QueryDevices(const SerialsCallback& callback) { | 81 void TCPDeviceProvider::QueryDevices(const SerialsCallback& callback) { |
82 std::vector<std::string> result; | 82 std::vector<std::string> result; |
83 for (const net::HostPortPair& target : targets_) { | 83 for (const net::HostPortPair& target : targets_) { |
84 const std::string& host = target.host(); | 84 const std::string& host = target.host(); |
85 if (ContainsValue(result, host)) | 85 if (base::ContainsValue(result, host)) |
86 continue; | 86 continue; |
87 result.push_back(host); | 87 result.push_back(host); |
88 } | 88 } |
89 callback.Run(result); | 89 callback.Run(result); |
90 } | 90 } |
91 | 91 |
92 void TCPDeviceProvider::QueryDeviceInfo(const std::string& serial, | 92 void TCPDeviceProvider::QueryDeviceInfo(const std::string& serial, |
93 const DeviceInfoCallback& callback) { | 93 const DeviceInfoCallback& callback) { |
94 AndroidDeviceManager::DeviceInfo device_info; | 94 AndroidDeviceManager::DeviceInfo device_info; |
95 device_info.model = kDeviceModel; | 95 device_info.model = kDeviceModel; |
(...skipping 30 matching lines...) Expand all Loading... |
126 release_callback_.Run(); | 126 release_callback_.Run(); |
127 } | 127 } |
128 | 128 |
129 void TCPDeviceProvider::set_release_callback_for_test( | 129 void TCPDeviceProvider::set_release_callback_for_test( |
130 const base::Closure& callback) { | 130 const base::Closure& callback) { |
131 release_callback_ = callback; | 131 release_callback_ = callback; |
132 } | 132 } |
133 | 133 |
134 TCPDeviceProvider::~TCPDeviceProvider() { | 134 TCPDeviceProvider::~TCPDeviceProvider() { |
135 } | 135 } |
OLD | NEW |