OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 CHROME_BROWSER_EXTENSIONS_EXTENSION_DOM_UI_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_DOM_UI_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_DOM_UI_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_DOM_UI_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/scoped_ptr.h" | 10 #include "base/scoped_ptr.h" |
11 #include "chrome/browser/dom_ui/dom_ui.h" | 11 #include "chrome/browser/dom_ui/dom_ui.h" |
12 #include "chrome/browser/extensions/extension_bookmark_manager_api.h" | 12 #include "chrome/browser/extensions/extension_bookmark_manager_api.h" |
13 #include "chrome/browser/extensions/extension_function_dispatcher.h" | 13 #include "chrome/browser/extensions/extension_function_dispatcher.h" |
14 #include "chrome/browser/extensions/extension_popup_host.h" | |
15 #include "chrome/common/extensions/extension.h" | 14 #include "chrome/common/extensions/extension.h" |
16 | 15 |
17 class ListValue; | 16 class ListValue; |
18 class PrefService; | 17 class PrefService; |
19 class Profile; | 18 class Profile; |
20 class RefCountedMemory; | 19 class RefCountedMemory; |
21 class RenderViewHost; | 20 class RenderViewHost; |
22 class TabContents; | 21 class TabContents; |
23 | 22 |
24 // This class implements DOMUI for extensions and allows extensions to put UI in | 23 // This class implements DOMUI for extensions and allows extensions to put UI in |
25 // the main tab contents area. | 24 // the main tab contents area. |
26 class ExtensionDOMUI | 25 class ExtensionDOMUI |
27 : public DOMUI, | 26 : public DOMUI, |
28 public ExtensionPopupHost::PopupDelegate, | |
29 public ExtensionFunctionDispatcher::Delegate { | 27 public ExtensionFunctionDispatcher::Delegate { |
30 public: | 28 public: |
31 explicit ExtensionDOMUI(TabContents* tab_contents); | 29 explicit ExtensionDOMUI(TabContents* tab_contents); |
32 | 30 |
33 ExtensionFunctionDispatcher* extension_function_dispatcher() const { | 31 ExtensionFunctionDispatcher* extension_function_dispatcher() const { |
34 return extension_function_dispatcher_.get(); | 32 return extension_function_dispatcher_.get(); |
35 } | 33 } |
36 | 34 |
37 // DOMUI | 35 // DOMUI |
38 virtual void RenderViewCreated(RenderViewHost* render_view_host); | 36 virtual void RenderViewCreated(RenderViewHost* render_view_host); |
39 virtual void RenderViewReused(RenderViewHost* render_view_host); | 37 virtual void RenderViewReused(RenderViewHost* render_view_host); |
40 virtual void ProcessDOMUIMessage(const std::string& message, | 38 virtual void ProcessDOMUIMessage(const std::string& message, |
41 const Value* content, | 39 const Value* content, |
42 int request_id, | 40 int request_id, |
43 bool has_callback); | 41 bool has_callback); |
44 | 42 |
45 // ExtensionFunctionDispatcher::Delegate | 43 // ExtensionFunctionDispatcher::Delegate |
46 virtual Browser* GetBrowser(bool include_incognito) const; | 44 virtual Browser* GetBrowser(bool include_incognito) const; |
47 virtual ExtensionDOMUI* GetExtensionDOMUI() { return this; } | 45 virtual ExtensionDOMUI* GetExtensionDOMUI() { return this; } |
48 virtual gfx::NativeWindow GetFrameNativeWindow(); | 46 virtual gfx::NativeWindow GetFrameNativeWindow(); |
49 | 47 |
50 // ExtensionPopupHost::Delegate | |
51 virtual Browser* GetBrowser() const { return GetBrowser(true); } | |
52 virtual RenderViewHost* GetRenderViewHost(); | 48 virtual RenderViewHost* GetRenderViewHost(); |
53 virtual Profile* GetProfile(); | 49 virtual Profile* GetProfile(); |
54 virtual gfx::NativeView GetNativeViewOfHost(); | 50 virtual gfx::NativeView GetNativeViewOfHost(); |
55 | 51 |
56 virtual ExtensionBookmarkManagerEventRouter* | 52 virtual ExtensionBookmarkManagerEventRouter* |
57 extension_bookmark_manager_event_router() { | 53 extension_bookmark_manager_event_router() { |
58 return extension_bookmark_manager_event_router_.get(); | 54 return extension_bookmark_manager_event_router_.get(); |
59 } | 55 } |
60 | 56 |
61 // BrowserURLHandler | 57 // BrowserURLHandler |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 | 89 |
94 void ResetExtensionBookmarkManagerEventRouter(); | 90 void ResetExtensionBookmarkManagerEventRouter(); |
95 | 91 |
96 scoped_ptr<ExtensionFunctionDispatcher> extension_function_dispatcher_; | 92 scoped_ptr<ExtensionFunctionDispatcher> extension_function_dispatcher_; |
97 | 93 |
98 scoped_ptr<ExtensionBookmarkManagerEventRouter> | 94 scoped_ptr<ExtensionBookmarkManagerEventRouter> |
99 extension_bookmark_manager_event_router_; | 95 extension_bookmark_manager_event_router_; |
100 }; | 96 }; |
101 | 97 |
102 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_DOM_UI_H_ | 98 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_DOM_UI_H_ |
OLD | NEW |