OLD | NEW |
---|---|
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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_DEVTOOLS_DEVTOOLS_ADB_BRIDGE_H_ | 5 #ifndef CHROME_BROWSER_DEVTOOLS_DEVTOOLS_ADB_BRIDGE_H_ |
6 #define CHROME_BROWSER_DEVTOOLS_DEVTOOLS_ADB_BRIDGE_H_ | 6 #define CHROME_BROWSER_DEVTOOLS_DEVTOOLS_ADB_BRIDGE_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
155 const std::string name_; | 155 const std::string name_; |
156 RemotePages pages_; | 156 RemotePages pages_; |
157 | 157 |
158 DISALLOW_COPY_AND_ASSIGN(RemoteBrowser); | 158 DISALLOW_COPY_AND_ASSIGN(RemoteBrowser); |
159 }; | 159 }; |
160 | 160 |
161 typedef std::vector<scoped_refptr<RemoteBrowser> > RemoteBrowsers; | 161 typedef std::vector<scoped_refptr<RemoteBrowser> > RemoteBrowsers; |
162 | 162 |
163 class RemoteDevice : public base::RefCounted<RemoteDevice> { | 163 class RemoteDevice : public base::RefCounted<RemoteDevice> { |
164 public: | 164 public: |
165 typedef int PortStatus; | |
166 typedef std::map<int, PortStatus> PortStatusMap; | |
167 | |
165 explicit RemoteDevice(scoped_refptr<DevToolsAdbBridge> bridge, | 168 explicit RemoteDevice(scoped_refptr<DevToolsAdbBridge> bridge, |
166 scoped_refptr<AndroidDevice> device); | 169 scoped_refptr<AndroidDevice> device); |
167 | 170 |
168 scoped_refptr<AndroidDevice> device() { return device_; } | 171 scoped_refptr<AndroidDevice> device() { return device_; } |
169 std::string serial() { return device_->serial(); } | 172 std::string serial() { return device_->serial(); } |
170 std::string model() { return device_->model(); } | 173 std::string model() { return device_->model(); } |
171 | 174 |
172 RemoteBrowsers& browsers() { return browsers_; } | 175 RemoteBrowsers& browsers() { return browsers_; } |
173 void AddBrowser(scoped_refptr<RemoteBrowser> browser) { | 176 void AddBrowser(scoped_refptr<RemoteBrowser> browser) { |
174 browsers_.push_back(browser); | 177 browsers_.push_back(browser); |
175 } | 178 } |
176 | 179 |
180 const PortStatusMap& port_status() { return port_status_; } | |
181 void SetPortStatus(const PortStatusMap& port_status) { | |
pfeldman
2013/08/08 16:43:22
set_port_status
Vladislav Kaznacheev
2013/08/09 08:24:58
Done.
| |
182 port_status_ = port_status; | |
183 } | |
184 | |
177 private: | 185 private: |
178 friend class base::RefCounted<RemoteDevice>; | 186 friend class base::RefCounted<RemoteDevice>; |
179 virtual ~RemoteDevice(); | 187 virtual ~RemoteDevice(); |
180 | 188 |
181 scoped_refptr<DevToolsAdbBridge> bridge_; | 189 scoped_refptr<DevToolsAdbBridge> bridge_; |
182 scoped_refptr<AndroidDevice> device_; | 190 scoped_refptr<AndroidDevice> device_; |
183 RemoteBrowsers browsers_; | 191 RemoteBrowsers browsers_; |
192 PortStatusMap port_status_; | |
184 | 193 |
185 DISALLOW_COPY_AND_ASSIGN(RemoteDevice); | 194 DISALLOW_COPY_AND_ASSIGN(RemoteDevice); |
186 }; | 195 }; |
187 | 196 |
188 typedef std::vector<scoped_refptr<RemoteDevice> > RemoteDevices; | 197 typedef std::vector<scoped_refptr<RemoteDevice> > RemoteDevices; |
189 | 198 |
190 class AndroidDevice : public base::RefCounted<AndroidDevice> { | 199 class AndroidDevice : public base::RefCounted<AndroidDevice> { |
191 public: | 200 public: |
192 explicit AndroidDevice(const std::string& serial); | 201 explicit AndroidDevice(const std::string& serial); |
193 | 202 |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
281 scoped_refptr<RefCountedAdbThread> adb_thread_; | 290 scoped_refptr<RefCountedAdbThread> adb_thread_; |
282 bool has_message_loop_; | 291 bool has_message_loop_; |
283 scoped_ptr<crypto::RSAPrivateKey> rsa_key_; | 292 scoped_ptr<crypto::RSAPrivateKey> rsa_key_; |
284 typedef std::vector<Listener*> Listeners; | 293 typedef std::vector<Listener*> Listeners; |
285 Listeners listeners_; | 294 Listeners listeners_; |
286 scoped_ptr<PortForwardingController> port_forwarding_controller_; | 295 scoped_ptr<PortForwardingController> port_forwarding_controller_; |
287 DISALLOW_COPY_AND_ASSIGN(DevToolsAdbBridge); | 296 DISALLOW_COPY_AND_ASSIGN(DevToolsAdbBridge); |
288 }; | 297 }; |
289 | 298 |
290 #endif // CHROME_BROWSER_DEVTOOLS_DEVTOOLS_ADB_BRIDGE_H_ | 299 #endif // CHROME_BROWSER_DEVTOOLS_DEVTOOLS_ADB_BRIDGE_H_ |
OLD | NEW |