OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
11 #include "base/scoped_ptr.h" | 11 #include "base/scoped_ptr.h" |
12 #include "chrome/browser/dom_ui/dom_ui.h" | 12 #include "chrome/browser/dom_ui/dom_ui.h" |
13 #include "chrome/browser/extensions/extension_bookmark_manager_api.h" | 13 #include "chrome/browser/extensions/extension_bookmark_manager_api.h" |
14 #include "chrome/browser/extensions/extension_function_dispatcher.h" | 14 #include "chrome/browser/extensions/extension_function_dispatcher.h" |
15 #include "chrome/browser/favicon_service.h" | 15 #include "chrome/browser/favicon_service.h" |
16 #include "chrome/common/extensions/extension.h" | 16 #include "chrome/common/extensions/extension.h" |
17 | 17 |
18 class ListValue; | 18 class ListValue; |
19 class PrefService; | 19 class PrefService; |
20 class Profile; | 20 class Profile; |
21 class RenderViewHost; | 21 class RenderViewHost; |
22 class TabContents; | 22 class TabContents; |
23 struct ViewHostMsg_DomMessage_Params; | 23 struct ViewHostMsg_DomMessage_Params; |
24 | 24 |
25 // This class implements DOMUI for extensions and allows extensions to put UI in | 25 // This class implements DOMUI for extensions and allows extensions to put UI in |
26 // the main tab contents area. | 26 // the main tab contents area. For example, each extension can specify an |
| 27 // "options_page", and that page is displayed in the tab contents area and is |
| 28 // hosted by this class. |
27 class ExtensionDOMUI | 29 class ExtensionDOMUI |
28 : public DOMUI, | 30 : public DOMUI, |
29 public ExtensionFunctionDispatcher::Delegate { | 31 public ExtensionFunctionDispatcher::Delegate { |
30 public: | 32 public: |
31 static const char kExtensionURLOverrides[]; | 33 static const char kExtensionURLOverrides[]; |
32 | 34 |
33 explicit ExtensionDOMUI(TabContents* tab_contents); | 35 explicit ExtensionDOMUI(TabContents* tab_contents); |
34 | 36 |
35 ExtensionFunctionDispatcher* extension_function_dispatcher() const { | 37 ExtensionFunctionDispatcher* extension_function_dispatcher() const { |
36 return extension_function_dispatcher_.get(); | 38 return extension_function_dispatcher_.get(); |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 | 87 |
86 // When the RenderViewHost changes (RenderViewCreated and RenderViewReused), | 88 // When the RenderViewHost changes (RenderViewCreated and RenderViewReused), |
87 // we need to reset the ExtensionFunctionDispatcher so it's talking to the | 89 // we need to reset the ExtensionFunctionDispatcher so it's talking to the |
88 // right one, as well as being linked to the correct URL. | 90 // right one, as well as being linked to the correct URL. |
89 void ResetExtensionFunctionDispatcher(RenderViewHost* render_view_host); | 91 void ResetExtensionFunctionDispatcher(RenderViewHost* render_view_host); |
90 | 92 |
91 void ResetExtensionBookmarkManagerEventRouter(); | 93 void ResetExtensionBookmarkManagerEventRouter(); |
92 | 94 |
93 scoped_ptr<ExtensionFunctionDispatcher> extension_function_dispatcher_; | 95 scoped_ptr<ExtensionFunctionDispatcher> extension_function_dispatcher_; |
94 | 96 |
| 97 // TODO(aa): This seems out of place. Why is it not with the event routers for |
| 98 // the other extension APIs? |
95 scoped_ptr<ExtensionBookmarkManagerEventRouter> | 99 scoped_ptr<ExtensionBookmarkManagerEventRouter> |
96 extension_bookmark_manager_event_router_; | 100 extension_bookmark_manager_event_router_; |
97 }; | 101 }; |
98 | 102 |
99 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_DOM_UI_H_ | 103 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_DOM_UI_H_ |
OLD | NEW |