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 #ifndef CHROME_BROWSER_DEVTOOLS_DEVICE_ANDROID_DEVICE_MANAGER_H_ | 5 #ifndef CHROME_BROWSER_DEVTOOLS_DEVICE_ANDROID_DEVICE_MANAGER_H_ |
6 #define CHROME_BROWSER_DEVTOOLS_DEVICE_ANDROID_DEVICE_MANAGER_H_ | 6 #define CHROME_BROWSER_DEVTOOLS_DEVICE_ANDROID_DEVICE_MANAGER_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 20 matching lines...) Expand all Loading... |
31 using HttpUpgradeCallback = base::Callback<void( | 31 using HttpUpgradeCallback = base::Callback<void( |
32 int result, | 32 int result, |
33 const std::string& extensions, | 33 const std::string& extensions, |
34 const std::string& body_head, | 34 const std::string& body_head, |
35 scoped_ptr<net::StreamSocket>)>; | 35 scoped_ptr<net::StreamSocket>)>; |
36 using SerialsCallback = | 36 using SerialsCallback = |
37 base::Callback<void(const std::vector<std::string>&)>; | 37 base::Callback<void(const std::vector<std::string>&)>; |
38 | 38 |
39 struct BrowserInfo { | 39 struct BrowserInfo { |
40 BrowserInfo(); | 40 BrowserInfo(); |
| 41 BrowserInfo(const BrowserInfo& other); |
41 | 42 |
42 enum Type { | 43 enum Type { |
43 kTypeChrome, | 44 kTypeChrome, |
44 kTypeWebView, | 45 kTypeWebView, |
45 kTypeOther | 46 kTypeOther |
46 }; | 47 }; |
47 | 48 |
48 std::string socket_name; | 49 std::string socket_name; |
49 std::string display_name; | 50 std::string display_name; |
50 std::string user; | 51 std::string user; |
51 Type type; | 52 Type type; |
52 }; | 53 }; |
53 | 54 |
54 struct DeviceInfo { | 55 struct DeviceInfo { |
55 DeviceInfo(); | 56 DeviceInfo(); |
| 57 DeviceInfo(const DeviceInfo& other); |
56 ~DeviceInfo(); | 58 ~DeviceInfo(); |
57 | 59 |
58 std::string model; | 60 std::string model; |
59 bool connected; | 61 bool connected; |
60 gfx::Size screen_size; | 62 gfx::Size screen_size; |
61 std::vector<BrowserInfo> browser_info; | 63 std::vector<BrowserInfo> browser_info; |
62 }; | 64 }; |
63 | 65 |
64 typedef base::Callback<void(const DeviceInfo&)> DeviceInfoCallback; | 66 typedef base::Callback<void(const DeviceInfo&)> DeviceInfoCallback; |
65 class Device; | 67 class Device; |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
200 static std::string GetBrowserName(const std::string& socket, | 202 static std::string GetBrowserName(const std::string& socket, |
201 const std::string& package); | 203 const std::string& package); |
202 using RunCommandCallback = | 204 using RunCommandCallback = |
203 base::Callback<void(const std::string&, const CommandCallback&)>; | 205 base::Callback<void(const std::string&, const CommandCallback&)>; |
204 | 206 |
205 static void QueryDeviceInfo(const RunCommandCallback& command_callback, | 207 static void QueryDeviceInfo(const RunCommandCallback& command_callback, |
206 const DeviceInfoCallback& callback); | 208 const DeviceInfoCallback& callback); |
207 | 209 |
208 struct DeviceDescriptor { | 210 struct DeviceDescriptor { |
209 DeviceDescriptor(); | 211 DeviceDescriptor(); |
| 212 DeviceDescriptor(const DeviceDescriptor& other); |
210 ~DeviceDescriptor(); | 213 ~DeviceDescriptor(); |
211 | 214 |
212 scoped_refptr<DeviceProvider> provider; | 215 scoped_refptr<DeviceProvider> provider; |
213 std::string serial; | 216 std::string serial; |
214 }; | 217 }; |
215 | 218 |
216 typedef std::vector<DeviceDescriptor> DeviceDescriptors; | 219 typedef std::vector<DeviceDescriptor> DeviceDescriptors; |
217 | 220 |
218 private: | 221 private: |
219 class HandlerThread : public base::RefCountedThreadSafe<HandlerThread> { | 222 class HandlerThread : public base::RefCountedThreadSafe<HandlerThread> { |
(...skipping 19 matching lines...) Expand all Loading... |
239 typedef std::map<std::string, base::WeakPtr<Device> > DeviceWeakMap; | 242 typedef std::map<std::string, base::WeakPtr<Device> > DeviceWeakMap; |
240 | 243 |
241 scoped_refptr<HandlerThread> handler_thread_; | 244 scoped_refptr<HandlerThread> handler_thread_; |
242 DeviceProviders providers_; | 245 DeviceProviders providers_; |
243 DeviceWeakMap devices_; | 246 DeviceWeakMap devices_; |
244 | 247 |
245 base::WeakPtrFactory<AndroidDeviceManager> weak_factory_; | 248 base::WeakPtrFactory<AndroidDeviceManager> weak_factory_; |
246 }; | 249 }; |
247 | 250 |
248 #endif // CHROME_BROWSER_DEVTOOLS_DEVICE_ANDROID_DEVICE_MANAGER_H_ | 251 #endif // CHROME_BROWSER_DEVTOOLS_DEVICE_ANDROID_DEVICE_MANAGER_H_ |
OLD | NEW |