| 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 CONTENT_PUBLIC_BROWSER_DEVTOOLS_MANAGER_DELEGATE_H_ | 5 #ifndef CONTENT_PUBLIC_BROWSER_DEVTOOLS_MANAGER_DELEGATE_H_ |
| 6 #define CONTENT_PUBLIC_BROWSER_DEVTOOLS_MANAGER_DELEGATE_H_ | 6 #define CONTENT_PUBLIC_BROWSER_DEVTOOLS_MANAGER_DELEGATE_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 | 28 |
| 29 // Returns DevToolsAgentHost type to use for given |host| target. | 29 // Returns DevToolsAgentHost type to use for given |host| target. |
| 30 virtual std::string GetTargetType(RenderFrameHost* host); | 30 virtual std::string GetTargetType(RenderFrameHost* host); |
| 31 | 31 |
| 32 // Returns DevToolsAgentHost title to use for given |host| target. | 32 // Returns DevToolsAgentHost title to use for given |host| target. |
| 33 virtual std::string GetTargetTitle(RenderFrameHost* host); | 33 virtual std::string GetTargetTitle(RenderFrameHost* host); |
| 34 | 34 |
| 35 // Returns DevToolsAgentHost title to use for given |host| target. | 35 // Returns DevToolsAgentHost title to use for given |host| target. |
| 36 virtual std::string GetTargetDescription(RenderFrameHost* host); | 36 virtual std::string GetTargetDescription(RenderFrameHost* host); |
| 37 | 37 |
| 38 // Returns all targets embedder would like to report as discoverable. | 38 // Returns all targets embedder would like to report as debuggable |
| 39 // If returns false, all targets content is aware of and only those | 39 // remotely. |
| 40 // should be discoverable. | 40 virtual DevToolsAgentHost::List RemoteDebuggingTargets(); |
| 41 virtual bool DiscoverTargets( | |
| 42 const DevToolsAgentHost::DiscoveryCallback& callback); | |
| 43 | 41 |
| 44 // Creates new inspectable target given the |url|. | 42 // Creates new inspectable target given the |url|. |
| 45 virtual scoped_refptr<DevToolsAgentHost> CreateNewTarget(const GURL& url); | 43 virtual scoped_refptr<DevToolsAgentHost> CreateNewTarget(const GURL& url); |
| 46 | 44 |
| 47 // Result ownership is passed to the caller. | 45 // Result ownership is passed to the caller. |
| 48 virtual base::DictionaryValue* HandleCommand( | 46 virtual base::DictionaryValue* HandleCommand( |
| 49 DevToolsAgentHost* agent_host, | 47 DevToolsAgentHost* agent_host, |
| 50 base::DictionaryValue* command); | 48 base::DictionaryValue* command); |
| 51 | 49 |
| 52 using CommandCallback = | 50 using CommandCallback = |
| 53 base::Callback<void(std::unique_ptr<base::DictionaryValue> response)>; | 51 base::Callback<void(std::unique_ptr<base::DictionaryValue> response)>; |
| 54 // Handle async command, feed response to CommandCallback when it is ready. | |
| 55 virtual bool HandleAsyncCommand(DevToolsAgentHost* agent_host, | 52 virtual bool HandleAsyncCommand(DevToolsAgentHost* agent_host, |
| 56 base::DictionaryValue* command, | 53 base::DictionaryValue* command, |
| 57 const CommandCallback& callback); | 54 const CommandCallback& callback); |
| 58 | |
| 59 // Should return discovery page HTML that should list available tabs | 55 // Should return discovery page HTML that should list available tabs |
| 60 // and provide attach links. | 56 // and provide attach links. |
| 61 virtual std::string GetDiscoveryPageHTML(); | 57 virtual std::string GetDiscoveryPageHTML(); |
| 62 | 58 |
| 63 // Returns frontend resource data by |path|. | 59 // Returns frontend resource data by |path|. |
| 64 virtual std::string GetFrontendResource(const std::string& path); | 60 virtual std::string GetFrontendResource(const std::string& path); |
| 65 | 61 |
| 66 virtual ~DevToolsManagerDelegate(); | 62 virtual ~DevToolsManagerDelegate(); |
| 67 }; | 63 }; |
| 68 | 64 |
| 69 } // namespace content | 65 } // namespace content |
| 70 | 66 |
| 71 #endif // CONTENT_PUBLIC_BROWSER_DEVTOOLS_MANAGER_DELEGATE_H_ | 67 #endif // CONTENT_PUBLIC_BROWSER_DEVTOOLS_MANAGER_DELEGATE_H_ |
| OLD | NEW |