| 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_CHROME_DEVTOOLS_MANAGER_DELEGATE_H_ | 5 #ifndef CHROME_BROWSER_DEVTOOLS_CHROME_DEVTOOLS_MANAGER_DELEGATE_H_ |
| 6 #define CHROME_BROWSER_DEVTOOLS_CHROME_DEVTOOLS_MANAGER_DELEGATE_H_ | 6 #define CHROME_BROWSER_DEVTOOLS_CHROME_DEVTOOLS_MANAGER_DELEGATE_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <set> | 9 #include <set> |
| 10 | 10 |
| 11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
| 12 #include "base/macros.h" | 12 #include "base/macros.h" |
| 13 #include "chrome/browser/devtools/device/devtools_device_discovery.h" | 13 #include "chrome/browser/devtools/device/devtools_device_discovery.h" |
| 14 #include "content/public/browser/devtools_agent_host_observer.h" | 14 #include "content/public/browser/devtools_agent_host_observer.h" |
| 15 #include "content/public/browser/devtools_manager_delegate.h" | 15 #include "content/public/browser/devtools_manager_delegate.h" |
| 16 #include "net/base/host_port_pair.h" | |
| 17 | 16 |
| 18 class DevToolsNetworkProtocolHandler; | 17 class DevToolsNetworkProtocolHandler; |
| 19 | 18 |
| 20 class ChromeDevToolsManagerDelegate : | 19 class ChromeDevToolsManagerDelegate : |
| 21 public content::DevToolsManagerDelegate, | 20 public content::DevToolsManagerDelegate, |
| 22 public content::DevToolsAgentHostObserver { | 21 public content::DevToolsAgentHostObserver { |
| 23 public: | 22 public: |
| 24 static char kTypeApp[]; | 23 static char kTypeApp[]; |
| 25 static char kTypeBackgroundPage[]; | 24 static char kTypeBackgroundPage[]; |
| 26 static char kTypeWebView[]; | 25 static char kTypeWebView[]; |
| 27 | 26 |
| 28 ChromeDevToolsManagerDelegate(); | 27 ChromeDevToolsManagerDelegate(); |
| 29 ~ChromeDevToolsManagerDelegate() override; | 28 ~ChromeDevToolsManagerDelegate() override; |
| 30 | 29 |
| 31 private: | 30 private: |
| 32 // content::DevToolsManagerDelegate implementation. | 31 // content::DevToolsManagerDelegate implementation. |
| 33 void Inspect(content::DevToolsAgentHost* agent_host) override; | 32 void Inspect(content::DevToolsAgentHost* agent_host) override; |
| 34 bool DiscoverTargets( | |
| 35 const content::DevToolsAgentHost::DiscoveryCallback& callback) override; | |
| 36 base::DictionaryValue* HandleCommand( | 33 base::DictionaryValue* HandleCommand( |
| 37 content::DevToolsAgentHost* agent_host, | 34 content::DevToolsAgentHost* agent_host, |
| 38 base::DictionaryValue* command_dict) override; | 35 base::DictionaryValue* command_dict) override; |
| 39 std::string GetTargetType(content::RenderFrameHost* host) override; | 36 std::string GetTargetType(content::RenderFrameHost* host) override; |
| 40 std::string GetTargetTitle(content::RenderFrameHost* host) override; | 37 std::string GetTargetTitle(content::RenderFrameHost* host) override; |
| 41 scoped_refptr<content::DevToolsAgentHost> CreateNewTarget( | 38 scoped_refptr<content::DevToolsAgentHost> CreateNewTarget( |
| 42 const GURL& url) override; | 39 const GURL& url) override; |
| 43 std::string GetDiscoveryPageHTML() override; | 40 std::string GetDiscoveryPageHTML() override; |
| 44 std::string GetFrontendResource(const std::string& path) override; | 41 std::string GetFrontendResource(const std::string& path) override; |
| 45 | 42 |
| 46 // content::DevToolsAgentHostObserver overrides. | 43 // content::DevToolsAgentHostObserver overrides. |
| 47 void DevToolsAgentHostAttached( | 44 void DevToolsAgentHostAttached( |
| 48 content::DevToolsAgentHost* agent_host) override; | 45 content::DevToolsAgentHost* agent_host) override; |
| 49 void DevToolsAgentHostDetached( | 46 void DevToolsAgentHostDetached( |
| 50 content::DevToolsAgentHost* agent_host) override; | 47 content::DevToolsAgentHost* agent_host) override; |
| 51 | 48 |
| 52 void DevicesAvailable( | 49 void DevicesAvailable( |
| 53 const content::DevToolsAgentHost::DiscoveryCallback& callback, | 50 const DevToolsDeviceDiscovery::CompleteDevices& devices); |
| 54 const DevToolsDeviceDiscovery::CompleteDevices& devices); | |
| 55 | 51 |
| 56 std::unique_ptr<base::DictionaryValue> SetRemoteLocations( | 52 std::unique_ptr<base::DictionaryValue> SetRemoteLocations( |
| 57 content::DevToolsAgentHost* agent_host, | 53 content::DevToolsAgentHost* agent_host, |
| 58 int command_id, | 54 int command_id, |
| 59 base::DictionaryValue* params); | 55 base::DictionaryValue* params); |
| 60 | 56 |
| 61 std::unique_ptr<DevToolsNetworkProtocolHandler> network_protocol_handler_; | 57 std::unique_ptr<DevToolsNetworkProtocolHandler> network_protocol_handler_; |
| 62 std::unique_ptr<AndroidDeviceManager> device_manager_; | 58 std::unique_ptr<AndroidDeviceManager> device_manager_; |
| 63 std::set<net::HostPortPair> tcp_locations_; | 59 std::unique_ptr<DevToolsDeviceDiscovery> device_discovery_; |
| 60 content::DevToolsAgentHost::List remote_agent_hosts_; |
| 61 content::DevToolsAgentHost* remote_locations_requester_; |
| 64 | 62 |
| 65 DISALLOW_COPY_AND_ASSIGN(ChromeDevToolsManagerDelegate); | 63 DISALLOW_COPY_AND_ASSIGN(ChromeDevToolsManagerDelegate); |
| 66 }; | 64 }; |
| 67 | 65 |
| 68 #endif // CHROME_BROWSER_DEVTOOLS_CHROME_DEVTOOLS_MANAGER_DELEGATE_H_ | 66 #endif // CHROME_BROWSER_DEVTOOLS_CHROME_DEVTOOLS_MANAGER_DELEGATE_H_ |
| OLD | NEW |