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 |
11 #include "base/callback.h" | 11 #include "base/callback.h" |
12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
14 #include "chrome/browser/devtools/adb/android_usb_device.h" | 14 #include "chrome/browser/devtools/adb/android_usb_device.h" |
15 #include "components/browser_context_keyed_service/browser_context_keyed_service
.h" | 15 #include "components/browser_context_keyed_service/browser_context_keyed_service
.h" |
16 #include "components/browser_context_keyed_service/browser_context_keyed_service
_factory.h" | 16 #include "components/browser_context_keyed_service/browser_context_keyed_service
_factory.h" |
17 #include "content/public/browser/browser_thread.h" | 17 #include "content/public/browser/browser_thread.h" |
18 #include "net/socket/tcp_client_socket.h" | 18 #include "net/socket/tcp_client_socket.h" |
| 19 #include "ui/gfx/size.h" |
19 | 20 |
20 template<typename T> struct DefaultSingletonTraits; | 21 template<typename T> struct DefaultSingletonTraits; |
21 | 22 |
22 namespace base { | 23 namespace base { |
23 class MessageLoop; | 24 class MessageLoop; |
24 class DictionaryValue; | 25 class DictionaryValue; |
25 class Thread; | 26 class Thread; |
26 } | 27 } |
27 | 28 |
28 namespace content { | 29 namespace content { |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 RemoteBrowsers& browsers() { return browsers_; } | 194 RemoteBrowsers& browsers() { return browsers_; } |
194 void AddBrowser(scoped_refptr<RemoteBrowser> browser) { | 195 void AddBrowser(scoped_refptr<RemoteBrowser> browser) { |
195 browsers_.push_back(browser); | 196 browsers_.push_back(browser); |
196 } | 197 } |
197 | 198 |
198 const PortStatusMap& port_status() { return port_status_; } | 199 const PortStatusMap& port_status() { return port_status_; } |
199 void set_port_status(const PortStatusMap& port_status) { | 200 void set_port_status(const PortStatusMap& port_status) { |
200 port_status_ = port_status; | 201 port_status_ = port_status; |
201 } | 202 } |
202 | 203 |
| 204 gfx::Size GetScreenSize() { return screen_size_; } |
| 205 void SetScreenSize(const gfx::Size& size) { screen_size_ = size; } |
| 206 |
203 private: | 207 private: |
204 friend class base::RefCounted<RemoteDevice>; | 208 friend class base::RefCounted<RemoteDevice>; |
205 virtual ~RemoteDevice(); | 209 virtual ~RemoteDevice(); |
206 | 210 |
207 scoped_refptr<DevToolsAdbBridge> bridge_; | 211 scoped_refptr<DevToolsAdbBridge> bridge_; |
208 scoped_refptr<AndroidDevice> device_; | 212 scoped_refptr<AndroidDevice> device_; |
209 RemoteBrowsers browsers_; | 213 RemoteBrowsers browsers_; |
210 PortStatusMap port_status_; | 214 PortStatusMap port_status_; |
| 215 gfx::Size screen_size_; |
211 | 216 |
212 DISALLOW_COPY_AND_ASSIGN(RemoteDevice); | 217 DISALLOW_COPY_AND_ASSIGN(RemoteDevice); |
213 }; | 218 }; |
214 | 219 |
215 typedef std::vector<scoped_refptr<RemoteDevice> > RemoteDevices; | 220 typedef std::vector<scoped_refptr<RemoteDevice> > RemoteDevices; |
216 | 221 |
217 class AndroidDevice : public base::RefCounted<AndroidDevice> { | 222 class AndroidDevice : public base::RefCounted<AndroidDevice> { |
218 public: | 223 public: |
219 explicit AndroidDevice(const std::string& serial); | 224 explicit AndroidDevice(const std::string& serial); |
220 | 225 |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
300 scoped_refptr<RefCountedAdbThread> adb_thread_; | 305 scoped_refptr<RefCountedAdbThread> adb_thread_; |
301 bool has_message_loop_; | 306 bool has_message_loop_; |
302 scoped_ptr<crypto::RSAPrivateKey> rsa_key_; | 307 scoped_ptr<crypto::RSAPrivateKey> rsa_key_; |
303 typedef std::vector<Listener*> Listeners; | 308 typedef std::vector<Listener*> Listeners; |
304 Listeners listeners_; | 309 Listeners listeners_; |
305 scoped_ptr<PortForwardingController> port_forwarding_controller_; | 310 scoped_ptr<PortForwardingController> port_forwarding_controller_; |
306 DISALLOW_COPY_AND_ASSIGN(DevToolsAdbBridge); | 311 DISALLOW_COPY_AND_ASSIGN(DevToolsAdbBridge); |
307 }; | 312 }; |
308 | 313 |
309 #endif // CHROME_BROWSER_DEVTOOLS_DEVTOOLS_ADB_BRIDGE_H_ | 314 #endif // CHROME_BROWSER_DEVTOOLS_DEVTOOLS_ADB_BRIDGE_H_ |
OLD | NEW |