| 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 "base/callback.h" |
| 9 |
| 8 namespace base { | 10 namespace base { |
| 9 class DictionaryValue; | 11 class DictionaryValue; |
| 10 } | 12 } |
| 11 | 13 |
| 14 class GURL; |
| 15 |
| 12 namespace content { | 16 namespace content { |
| 13 | 17 |
| 14 class BrowserContext; | 18 class BrowserContext; |
| 15 class DevToolsAgentHost; | 19 class DevToolsAgentHost; |
| 20 class DevToolsTarget; |
| 16 | 21 |
| 17 class DevToolsManagerDelegate { | 22 class DevToolsManagerDelegate { |
| 18 public: | 23 public: |
| 19 virtual ~DevToolsManagerDelegate() {} | 24 virtual ~DevToolsManagerDelegate() {} |
| 20 | 25 |
| 21 // Opens the inspector for |agent_host|. | 26 // Opens the inspector for |agent_host|. |
| 22 virtual void Inspect(BrowserContext* browser_context, | 27 virtual void Inspect(BrowserContext* browser_context, |
| 23 DevToolsAgentHost* agent_host) = 0; | 28 DevToolsAgentHost* agent_host) = 0; |
| 24 | 29 |
| 25 virtual void DevToolsAgentStateChanged(DevToolsAgentHost* agent_host, | 30 virtual void DevToolsAgentStateChanged(DevToolsAgentHost* agent_host, |
| 26 bool attached) = 0; | 31 bool attached) = 0; |
| 27 | 32 |
| 28 // Result ownership is passed to the caller. | 33 // Result ownership is passed to the caller. |
| 29 virtual base::DictionaryValue* HandleCommand( | 34 virtual base::DictionaryValue* HandleCommand( |
| 30 DevToolsAgentHost* agent_host, | 35 DevToolsAgentHost* agent_host, |
| 31 base::DictionaryValue* command) = 0; | 36 base::DictionaryValue* command) = 0; |
| 37 |
| 38 // Creates new inspectable target. |
| 39 virtual scoped_ptr<DevToolsTarget> CreateNewTarget(const GURL& url) = 0; |
| 40 |
| 41 typedef std::vector<DevToolsTarget*> TargetList; |
| 42 typedef base::Callback<void(const TargetList&)> TargetCallback; |
| 43 |
| 44 // Requests the list of all inspectable targets. |
| 45 // The caller gets the ownership of the returned targets. |
| 46 virtual void EnumerateTargets(TargetCallback callback) = 0; |
| 47 |
| 48 // Get a thumbnail for a given page. Returns non-empty string iff we have the |
| 49 // thumbnail. |
| 50 virtual std::string GetPageThumbnailData(const GURL& url) = 0; |
| 32 }; | 51 }; |
| 33 | 52 |
| 34 } // namespace content | 53 } // namespace content |
| 35 | 54 |
| 36 #endif // CONTENT_PUBLIC_BROWSER_DEVTOOLS_MANAGER_DELEGATE_H_ | 55 #endif // CONTENT_PUBLIC_BROWSER_DEVTOOLS_MANAGER_DELEGATE_H_ |
| OLD | NEW |