| 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 HEADLESS_LIB_BROWSER_HEADLESS_DEVTOOLS_MANAGER_DELEGATE_H_ | 5 #ifndef HEADLESS_LIB_BROWSER_HEADLESS_DEVTOOLS_MANAGER_DELEGATE_H_ |
| 6 #define HEADLESS_LIB_BROWSER_HEADLESS_DEVTOOLS_MANAGER_DELEGATE_H_ | 6 #define HEADLESS_LIB_BROWSER_HEADLESS_DEVTOOLS_MANAGER_DELEGATE_H_ |
| 7 | 7 |
| 8 #include "content/public/browser/devtools_manager_delegate.h" | 8 #include "content/public/browser/devtools_manager_delegate.h" |
| 9 | 9 |
| 10 #include <map> | 10 #include <map> |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 // DevToolsManagerDelegate implementation: | 29 // DevToolsManagerDelegate implementation: |
| 30 void Inspect(content::DevToolsAgentHost* agent_host) override {} | 30 void Inspect(content::DevToolsAgentHost* agent_host) override {} |
| 31 void DevToolsAgentStateChanged(content::DevToolsAgentHost* agent_host, | 31 void DevToolsAgentStateChanged(content::DevToolsAgentHost* agent_host, |
| 32 bool attached) override{}; | 32 bool attached) override{}; |
| 33 base::DictionaryValue* HandleCommand(content::DevToolsAgentHost* agent_host, | 33 base::DictionaryValue* HandleCommand(content::DevToolsAgentHost* agent_host, |
| 34 base::DictionaryValue* command) override; | 34 base::DictionaryValue* command) override; |
| 35 std::string GetTargetType(content::RenderFrameHost* host) override; | 35 std::string GetTargetType(content::RenderFrameHost* host) override; |
| 36 std::string GetTargetTitle(content::RenderFrameHost* host) override; | 36 std::string GetTargetTitle(content::RenderFrameHost* host) override; |
| 37 scoped_refptr<content::DevToolsAgentHost> CreateNewTarget( | 37 scoped_refptr<content::DevToolsAgentHost> CreateNewTarget( |
| 38 const GURL& url) override; | 38 const GURL& url) override; |
| 39 std::string GetDiscoveryPageHTML() override; |
| 40 std::string GetFrontendResource(const std::string& path) override; |
| 39 | 41 |
| 40 private: | 42 private: |
| 41 std::unique_ptr<base::Value> CreateTarget( | 43 std::unique_ptr<base::Value> CreateTarget( |
| 42 const base::DictionaryValue* params); | 44 const base::DictionaryValue* params); |
| 43 std::unique_ptr<base::Value> CloseTarget(const base::DictionaryValue* params); | 45 std::unique_ptr<base::Value> CloseTarget(const base::DictionaryValue* params); |
| 44 std::unique_ptr<base::Value> CreateBrowserContext( | 46 std::unique_ptr<base::Value> CreateBrowserContext( |
| 45 const base::DictionaryValue* params); | 47 const base::DictionaryValue* params); |
| 46 std::unique_ptr<base::Value> DisposeBrowserContext( | 48 std::unique_ptr<base::Value> DisposeBrowserContext( |
| 47 const base::DictionaryValue* params); | 49 const base::DictionaryValue* params); |
| 48 | 50 |
| 49 base::WeakPtr<HeadlessBrowserImpl> browser_; | 51 base::WeakPtr<HeadlessBrowserImpl> browser_; |
| 50 | 52 |
| 51 using CommandMemberFnPtr = std::unique_ptr<base::Value> ( | 53 using CommandMemberFnPtr = std::unique_ptr<base::Value> ( |
| 52 HeadlessDevToolsManagerDelegate::*)(const base::DictionaryValue* params); | 54 HeadlessDevToolsManagerDelegate::*)(const base::DictionaryValue* params); |
| 53 | 55 |
| 54 std::map<std::string, CommandMemberFnPtr> command_map_; | 56 std::map<std::string, CommandMemberFnPtr> command_map_; |
| 55 | 57 |
| 56 HeadlessBrowserContext* default_browser_context_; | 58 HeadlessBrowserContext* default_browser_context_; |
| 57 }; | 59 }; |
| 58 | 60 |
| 59 } // namespace headless | 61 } // namespace headless |
| 60 | 62 |
| 61 #endif // HEADLESS_LIB_BROWSER_HEADLESS_DEVTOOLS_MANAGER_DELEGATE_H_ | 63 #endif // HEADLESS_LIB_BROWSER_HEADLESS_DEVTOOLS_MANAGER_DELEGATE_H_ |
| OLD | NEW |