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_DEVTOOLS_ANDROID_BRIDGE_H_ | 5 #ifndef CHROME_BROWSER_DEVTOOLS_DEVICE_DEVTOOLS_ANDROID_BRIDGE_H_ |
6 #define CHROME_BROWSER_DEVTOOLS_DEVICE_DEVTOOLS_ANDROID_BRIDGE_H_ | 6 #define CHROME_BROWSER_DEVTOOLS_DEVICE_DEVTOOLS_ANDROID_BRIDGE_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 DISALLOW_COPY_AND_ASSIGN(Factory); | 62 DISALLOW_COPY_AND_ASSIGN(Factory); |
63 }; | 63 }; |
64 | 64 |
65 typedef std::pair<std::string, std::string> BrowserId; | 65 typedef std::pair<std::string, std::string> BrowserId; |
66 | 66 |
67 class RemotePage : public base::RefCounted<RemotePage> { | 67 class RemotePage : public base::RefCounted<RemotePage> { |
68 public: | 68 public: |
69 const std::string& serial() { return browser_id_.first; } | 69 const std::string& serial() { return browser_id_.first; } |
70 const std::string& socket() { return browser_id_.second; } | 70 const std::string& socket() { return browser_id_.second; } |
71 const std::string& frontend_url() { return frontend_url_; } | 71 const std::string& frontend_url() { return frontend_url_; } |
72 bool is_web_view() { return is_web_view_; } | |
73 | 72 |
74 private: | 73 private: |
75 friend class base::RefCounted<RemotePage>; | 74 friend class base::RefCounted<RemotePage>; |
76 friend class DevToolsAndroidBridge; | 75 friend class DevToolsAndroidBridge; |
77 | 76 |
78 RemotePage(const BrowserId& browser_id, | 77 RemotePage(const BrowserId& browser_id, const base::DictionaryValue& dict); |
79 const base::DictionaryValue& dict, | |
80 bool is_web_view); | |
81 | 78 |
82 virtual ~RemotePage(); | 79 virtual ~RemotePage(); |
83 | 80 |
84 BrowserId browser_id_; | 81 BrowserId browser_id_; |
85 std::string frontend_url_; | 82 std::string frontend_url_; |
86 bool is_web_view_; | |
87 scoped_ptr<base::DictionaryValue> dict_; | 83 scoped_ptr<base::DictionaryValue> dict_; |
88 | 84 |
89 DISALLOW_COPY_AND_ASSIGN(RemotePage); | 85 DISALLOW_COPY_AND_ASSIGN(RemotePage); |
90 }; | 86 }; |
91 | 87 |
92 typedef std::vector<scoped_refptr<RemotePage> > RemotePages; | 88 typedef std::vector<scoped_refptr<RemotePage> > RemotePages; |
93 typedef base::Callback<void(int, const std::string&)> JsonRequestCallback; | 89 typedef base::Callback<void(int, const std::string&)> JsonRequestCallback; |
94 | 90 |
95 class RemoteBrowser : public base::RefCounted<RemoteBrowser> { | 91 class RemoteBrowser : public base::RefCounted<RemoteBrowser> { |
96 public: | 92 public: |
97 const std::string& serial() { return browser_id_.first; } | 93 const std::string& serial() { return browser_id_.first; } |
98 const std::string& socket() { return browser_id_.second; } | 94 const std::string& socket() { return browser_id_.second; } |
99 const std::string& display_name() { return display_name_; } | 95 const std::string& display_name() { return display_name_; } |
100 const std::string& user() { return user_; } | 96 const std::string& user() { return user_; } |
101 const std::string& version() { return version_; } | 97 const std::string& version() { return version_; } |
102 const RemotePages& pages() { return pages_; } | 98 const RemotePages& pages() { return pages_; } |
103 | 99 |
104 bool IsChrome(); | 100 bool IsChrome(); |
105 bool IsWebView(); | |
106 std::string GetId(); | 101 std::string GetId(); |
107 | 102 |
108 typedef std::vector<int> ParsedVersion; | 103 typedef std::vector<int> ParsedVersion; |
109 ParsedVersion GetParsedVersion(); | 104 ParsedVersion GetParsedVersion(); |
110 | 105 |
111 private: | 106 private: |
112 friend class base::RefCounted<RemoteBrowser>; | 107 friend class base::RefCounted<RemoteBrowser>; |
113 friend class DevToolsAndroidBridge; | 108 friend class DevToolsAndroidBridge; |
114 | 109 |
115 RemoteBrowser(const std::string& serial, | 110 RemoteBrowser(const std::string& serial, |
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
321 scoped_ptr<PortForwardingController> port_forwarding_controller_; | 316 scoped_ptr<PortForwardingController> port_forwarding_controller_; |
322 | 317 |
323 PrefChangeRegistrar pref_change_registrar_; | 318 PrefChangeRegistrar pref_change_registrar_; |
324 | 319 |
325 base::WeakPtrFactory<DevToolsAndroidBridge> weak_factory_; | 320 base::WeakPtrFactory<DevToolsAndroidBridge> weak_factory_; |
326 | 321 |
327 DISALLOW_COPY_AND_ASSIGN(DevToolsAndroidBridge); | 322 DISALLOW_COPY_AND_ASSIGN(DevToolsAndroidBridge); |
328 }; | 323 }; |
329 | 324 |
330 #endif // CHROME_BROWSER_DEVTOOLS_DEVICE_DEVTOOLS_ANDROID_BRIDGE_H_ | 325 #endif // CHROME_BROWSER_DEVTOOLS_DEVICE_DEVTOOLS_ANDROID_BRIDGE_H_ |
OLD | NEW |