OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_HTTP_HANDLER_DELEGATE_H_ | 5 #ifndef CONTENT_PUBLIC_BROWSER_DEVTOOLS_HTTP_HANDLER_DELEGATE_H_ |
6 #define CONTENT_PUBLIC_BROWSER_DEVTOOLS_HTTP_HANDLER_DELEGATE_H_ | 6 #define CONTENT_PUBLIC_BROWSER_DEVTOOLS_HTTP_HANDLER_DELEGATE_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
11 | 11 |
12 namespace content { | 12 namespace content { |
13 | 13 |
14 class RenderViewHost; | |
14 class WebContents; | 15 class WebContents; |
15 | 16 |
16 class DevToolsHttpHandlerDelegate { | 17 class DevToolsHttpHandlerDelegate { |
17 public: | 18 public: |
18 typedef std::vector<WebContents*> InspectableTabs; | 19 // Interface responsible for mapping RenderViewHost instances to/from string |
20 // identifiers. | |
21 class BindingHandler { | |
pfeldman
2012/04/25 05:45:15
If this binding is really optional, I'd rather mov
Marshall
2012/04/25 15:14:57
Done.
| |
22 public: | |
23 virtual ~BindingHandler() {} | |
24 | |
25 // Returns the mapping of RenderViewHost to identifier. | |
26 virtual std::string GetRenderViewHostIdentifier(RenderViewHost* rvh) = 0; | |
pfeldman
2012/04/25 05:45:15
If you rename the interface to RenderViewHostBindi
Marshall
2012/04/25 15:14:57
Done.
| |
27 | |
28 // Return the mapping of identifier to RenderViewHost. | |
29 virtual RenderViewHost* GetRenderViewHostBinding( | |
30 const std::string& identifier) = 0; | |
31 | |
32 // Called when the binding has been reset. | |
33 virtual void ResetRenderViewHostBinding() = 0; | |
34 }; | |
35 | |
19 virtual ~DevToolsHttpHandlerDelegate() {} | 36 virtual ~DevToolsHttpHandlerDelegate() {} |
20 | 37 |
21 // Should return discovery page HTML that should list available tabs | 38 // Should return discovery page HTML that should list available tabs |
22 // and provide attach links. Called on the IO thread. | 39 // and provide attach links. Called on the IO thread. |
23 virtual std::string GetDiscoveryPageHTML() = 0; | 40 virtual std::string GetDiscoveryPageHTML() = 0; |
24 | 41 |
25 // Returns true if and only if frontend resources are bundled. | 42 // Returns true if and only if frontend resources are bundled. |
26 virtual bool BundlesFrontendResources() = 0; | 43 virtual bool BundlesFrontendResources() = 0; |
27 | 44 |
28 // Returns URL that front-end files are available at, empty string if | 45 // Returns URL that front-end files are available at, empty string if |
29 // no internal server is available. | 46 // no internal server is available. |
30 virtual std::string GetFrontendResourcesBaseURL() = 0; | 47 virtual std::string GetFrontendResourcesBaseURL() = 0; |
48 | |
49 // Return a BindingHandler instance or NULL to use the default binding | |
50 // implementation. The caller will take ownership of the returned pointer. | |
51 virtual BindingHandler* GetBindingHandler() { | |
52 return NULL; | |
53 } | |
31 }; | 54 }; |
32 | 55 |
33 } // namespace content | 56 } // namespace content |
34 | 57 |
35 #endif // CONTENT_PUBLIC_BROWSER_DEVTOOLS_HTTP_HANDLER_DELEGATE_H_ | 58 #endif // CONTENT_PUBLIC_BROWSER_DEVTOOLS_HTTP_HANDLER_DELEGATE_H_ |
OLD | NEW |