| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 CONTENT_BROWSER_DEVTOOLS_PROTOCOL_BROWSER_HANDLER_H_ | 5 #ifndef CONTENT_BROWSER_DEVTOOLS_PROTOCOL_BROWSER_HANDLER_H_ |
| 6 #define CONTENT_BROWSER_DEVTOOLS_PROTOCOL_BROWSER_HANDLER_H_ | 6 #define CONTENT_BROWSER_DEVTOOLS_PROTOCOL_BROWSER_HANDLER_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 namespace browser { | 25 namespace browser { |
| 26 | 26 |
| 27 class BrowserHandler : public DevToolsAgentHostClient { | 27 class BrowserHandler : public DevToolsAgentHostClient { |
| 28 public: | 28 public: |
| 29 using Response = DevToolsProtocolClient::Response; | 29 using Response = DevToolsProtocolClient::Response; |
| 30 | 30 |
| 31 BrowserHandler(); | 31 BrowserHandler(); |
| 32 ~BrowserHandler() override; | 32 ~BrowserHandler() override; |
| 33 | 33 |
| 34 void SetClient(std::unique_ptr<Client> client); | 34 void SetClient(std::unique_ptr<Client> client); |
| 35 void Detached(); |
| 35 | 36 |
| 36 Response CreateBrowserContext(std::string* out_context_id); | 37 Response CreateBrowserContext(std::string* out_context_id); |
| 37 Response DisposeBrowserContext(const std::string& context_id, | 38 Response DisposeBrowserContext(const std::string& context_id, |
| 38 bool* out_success); | 39 bool* out_success); |
| 39 Response CreateTarget(const std::string& url, | 40 Response CreateTarget(const std::string& url, |
| 40 const int* width, | 41 const int* width, |
| 41 const int* height, | 42 const int* height, |
| 42 const std::string* context_id, | 43 const std::string* context_id, |
| 43 std::string* out_target_id); | 44 std::string* out_target_id); |
| 44 Response CloseTarget(const std::string& target_id, bool* out_success); | 45 Response CloseTarget(const std::string& target_id, bool* out_success); |
| 45 Response GetTargets(DevToolsCommandId command_id); | 46 Response GetTargets(DevToolsCommandId command_id); |
| 46 Response Attach(DevToolsCommandId command_id, | 47 Response Attach(DevToolsCommandId command_id, |
| 47 const std::string& target_id); | 48 const std::string& target_id); |
| 48 Response Detach(const std::string& target_id, bool* out_success); | 49 Response Detach(const std::string& target_id, bool* out_success); |
| 49 Response SendMessage(const std::string& target_id, | 50 Response SendMessage(const std::string& target_id, |
| 50 const std::string& message); | 51 const std::string& message); |
| 52 Response SetRemoteLocations( |
| 53 const std::vector<std::unique_ptr<base::DictionaryValue>>&); |
| 51 | 54 |
| 52 private: | 55 private: |
| 53 void DispatchProtocolMessage(DevToolsAgentHost* agent_host, | 56 void DispatchProtocolMessage(DevToolsAgentHost* agent_host, |
| 54 const std::string& message) override; | 57 const std::string& message) override; |
| 55 | 58 |
| 56 void AgentHostClosed(DevToolsAgentHost* agent_host, | 59 void AgentHostClosed(DevToolsAgentHost* agent_host, |
| 57 bool replaced_with_another_client) override; | 60 bool replaced_with_another_client) override; |
| 58 | 61 |
| 59 void RespondToGetTargets(DevToolsCommandId command_id, | 62 void RespondToGetTargets(DevToolsCommandId command_id, |
| 60 DevToolsAgentHost::List list); | 63 DevToolsAgentHost::List list); |
| 61 void RespondToAttach(DevToolsCommandId command_id, | 64 void RespondToAttach(DevToolsCommandId command_id, |
| 62 const std::string& target_id, | 65 const std::string& target_id, |
| 63 DevToolsAgentHost::List agents); | 66 DevToolsAgentHost::List agents); |
| 64 | 67 |
| 65 std::unique_ptr<Client> client_; | 68 std::unique_ptr<Client> client_; |
| 66 DevToolsAgentHost::List attached_hosts_; | 69 DevToolsAgentHost::List attached_hosts_; |
| 67 base::WeakPtrFactory<BrowserHandler> weak_factory_; | 70 base::WeakPtrFactory<BrowserHandler> weak_factory_; |
| 68 DISALLOW_COPY_AND_ASSIGN(BrowserHandler); | 71 DISALLOW_COPY_AND_ASSIGN(BrowserHandler); |
| 69 }; | 72 }; |
| 70 | 73 |
| 71 } // namespace browser | 74 } // namespace browser |
| 72 } // namespace devtools | 75 } // namespace devtools |
| 73 } // namespace content | 76 } // namespace content |
| 74 | 77 |
| 75 #endif // CONTENT_BROWSER_DEVTOOLS_PROTOCOL_BROWSER_HANDLER_H_ | 78 #endif // CONTENT_BROWSER_DEVTOOLS_PROTOCOL_BROWSER_HANDLER_H_ |
| OLD | NEW |