| 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 <string> | 8 #include <string> |
| 9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
| 10 #include "content/common/content_export.h" |
| 10 #include "url/gurl.h" | 11 #include "url/gurl.h" |
| 11 | 12 |
| 12 namespace base { | 13 namespace base { |
| 13 class DictionaryValue; | 14 class DictionaryValue; |
| 14 } | 15 } |
| 15 | 16 |
| 16 namespace content { | 17 namespace content { |
| 17 | 18 |
| 18 class BrowserContext; | 19 class BrowserContext; |
| 19 class DevToolsAgentHost; | 20 class DevToolsAgentHost; |
| 20 class RenderFrameHost; | 21 class RenderFrameHost; |
| 21 | 22 |
| 22 class DevToolsManagerDelegate { | 23 class CONTENT_EXPORT DevToolsManagerDelegate { |
| 23 public: | 24 public: |
| 24 virtual ~DevToolsManagerDelegate() {} | |
| 25 | |
| 26 // Opens the inspector for |agent_host|. | 25 // Opens the inspector for |agent_host|. |
| 27 virtual void Inspect(DevToolsAgentHost* agent_host) = 0; | 26 virtual void Inspect(DevToolsAgentHost* agent_host); |
| 28 | 27 |
| 29 virtual void DevToolsAgentStateChanged(DevToolsAgentHost* agent_host, | 28 virtual void DevToolsAgentStateChanged(DevToolsAgentHost* agent_host, |
| 30 bool attached) = 0; | 29 bool attached); |
| 31 | 30 |
| 32 // Returns DevToolsAgentHost type to use for given |host| target. | 31 // Returns DevToolsAgentHost type to use for given |host| target. |
| 33 virtual std::string GetTargetType(RenderFrameHost* host) = 0; | 32 virtual std::string GetTargetType(RenderFrameHost* host); |
| 34 | 33 |
| 35 // Returns DevToolsAgentHost title to use for given |host| target. | 34 // Returns DevToolsAgentHost title to use for given |host| target. |
| 36 virtual std::string GetTargetTitle(RenderFrameHost* host) = 0; | 35 virtual std::string GetTargetTitle(RenderFrameHost* host); |
| 36 |
| 37 // Returns DevToolsAgentHost title to use for given |host| target. |
| 38 virtual std::string GetTargetDescription(RenderFrameHost* host); |
| 37 | 39 |
| 38 // Creates new inspectable target given the |url|. | 40 // Creates new inspectable target given the |url|. |
| 39 virtual scoped_refptr<DevToolsAgentHost> CreateNewTarget(const GURL& url) = 0; | 41 virtual scoped_refptr<DevToolsAgentHost> CreateNewTarget(const GURL& url); |
| 40 | 42 |
| 41 // Result ownership is passed to the caller. | 43 // Result ownership is passed to the caller. |
| 42 virtual base::DictionaryValue* HandleCommand( | 44 virtual base::DictionaryValue* HandleCommand( |
| 43 DevToolsAgentHost* agent_host, | 45 DevToolsAgentHost* agent_host, |
| 44 base::DictionaryValue* command) = 0; | 46 base::DictionaryValue* command); |
| 47 |
| 48 // Should return discovery page HTML that should list available tabs |
| 49 // and provide attach links. |
| 50 virtual std::string GetDiscoveryPageHTML(); |
| 51 |
| 52 // Returns frontend resource data by |path|. |
| 53 virtual std::string GetFrontendResource(const std::string& path); |
| 54 |
| 55 virtual ~DevToolsManagerDelegate(); |
| 45 }; | 56 }; |
| 46 | 57 |
| 47 } // namespace content | 58 } // namespace content |
| 48 | 59 |
| 49 #endif // CONTENT_PUBLIC_BROWSER_DEVTOOLS_MANAGER_DELEGATE_H_ | 60 #endif // CONTENT_PUBLIC_BROWSER_DEVTOOLS_MANAGER_DELEGATE_H_ |
| OLD | NEW |