| 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 |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 // "options_page", and that page is displayed in the tab contents area and is | 28 // "options_page", and that page is displayed in the tab contents area and is |
| 29 // hosted by this class. | 29 // hosted by this class. |
| 30 class ExtensionDOMUI | 30 class ExtensionDOMUI |
| 31 : public DOMUI, | 31 : public DOMUI, |
| 32 public ExtensionFunctionDispatcher::Delegate { | 32 public ExtensionFunctionDispatcher::Delegate { |
| 33 public: | 33 public: |
| 34 static const char kExtensionURLOverrides[]; | 34 static const char kExtensionURLOverrides[]; |
| 35 | 35 |
| 36 explicit ExtensionDOMUI(TabContents* tab_contents, GURL url); | 36 explicit ExtensionDOMUI(TabContents* tab_contents, GURL url); |
| 37 | 37 |
| 38 virtual ~ExtensionDOMUI(); |
| 39 |
| 38 ExtensionFunctionDispatcher* extension_function_dispatcher() const { | 40 ExtensionFunctionDispatcher* extension_function_dispatcher() const { |
| 39 return extension_function_dispatcher_.get(); | 41 return extension_function_dispatcher_.get(); |
| 40 } | 42 } |
| 41 | 43 |
| 42 // DOMUI | 44 // DOMUI |
| 43 virtual void RenderViewCreated(RenderViewHost* render_view_host); | 45 virtual void RenderViewCreated(RenderViewHost* render_view_host); |
| 44 virtual void RenderViewReused(RenderViewHost* render_view_host); | 46 virtual void RenderViewReused(RenderViewHost* render_view_host); |
| 45 virtual void ProcessDOMUIMessage(const ViewHostMsg_DomMessage_Params& params); | 47 virtual void ProcessDOMUIMessage(const ViewHostMsg_DomMessage_Params& params); |
| 46 | 48 |
| 47 // ExtensionFunctionDispatcher::Delegate | 49 // ExtensionFunctionDispatcher::Delegate |
| 48 virtual Browser* GetBrowser() const; | 50 virtual Browser* GetBrowser() const; |
| 49 virtual gfx::NativeView GetNativeViewOfHost(); | 51 virtual gfx::NativeView GetNativeViewOfHost(); |
| 50 virtual gfx::NativeWindow GetCustomFrameNativeWindow(); | 52 virtual gfx::NativeWindow GetCustomFrameNativeWindow(); |
| 51 virtual TabContents* associated_tab_contents() const { | 53 virtual TabContents* associated_tab_contents() const; |
| 52 return tab_contents(); | |
| 53 } | |
| 54 virtual Profile* GetProfile(); | 54 virtual Profile* GetProfile(); |
| 55 | 55 |
| 56 virtual ExtensionBookmarkManagerEventRouter* | 56 virtual ExtensionBookmarkManagerEventRouter* |
| 57 extension_bookmark_manager_event_router() { | 57 extension_bookmark_manager_event_router(); |
| 58 return extension_bookmark_manager_event_router_.get(); | |
| 59 } | |
| 60 | 58 |
| 61 // BrowserURLHandler | 59 // BrowserURLHandler |
| 62 static bool HandleChromeURLOverride(GURL* url, Profile* profile); | 60 static bool HandleChromeURLOverride(GURL* url, Profile* profile); |
| 63 | 61 |
| 64 // Register and unregister a dictionary of one or more overrides. | 62 // Register and unregister a dictionary of one or more overrides. |
| 65 // Page names are the keys, and chrome-extension: URLs are the values. | 63 // Page names are the keys, and chrome-extension: URLs are the values. |
| 66 // (e.g. { "newtab": "chrome-extension://<id>/my_new_tab.html" } | 64 // (e.g. { "newtab": "chrome-extension://<id>/my_new_tab.html" } |
| 67 static void RegisterChromeURLOverrides(Profile* profile, | 65 static void RegisterChromeURLOverrides(Profile* profile, |
| 68 const Extension::URLOverrideMap& overrides); | 66 const Extension::URLOverrideMap& overrides); |
| 69 static void UnregisterChromeURLOverrides(Profile* profile, | 67 static void UnregisterChromeURLOverrides(Profile* profile, |
| (...skipping 27 matching lines...) Expand all Loading... |
| 97 | 95 |
| 98 scoped_ptr<ExtensionFunctionDispatcher> extension_function_dispatcher_; | 96 scoped_ptr<ExtensionFunctionDispatcher> extension_function_dispatcher_; |
| 99 | 97 |
| 100 // TODO(aa): This seems out of place. Why is it not with the event routers for | 98 // TODO(aa): This seems out of place. Why is it not with the event routers for |
| 101 // the other extension APIs? | 99 // the other extension APIs? |
| 102 scoped_ptr<ExtensionBookmarkManagerEventRouter> | 100 scoped_ptr<ExtensionBookmarkManagerEventRouter> |
| 103 extension_bookmark_manager_event_router_; | 101 extension_bookmark_manager_event_router_; |
| 104 }; | 102 }; |
| 105 | 103 |
| 106 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_DOM_UI_H_ | 104 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_DOM_UI_H_ |
| OLD | NEW |