| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_WEB_UI_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_WEB_UI_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_WEB_UI_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_WEB_UI_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 // "options_page", and that page is displayed in the tab contents area and is | 30 // "options_page", and that page is displayed in the tab contents area and is |
| 31 // hosted by this class. | 31 // hosted by this class. |
| 32 class ExtensionWebUI : public ChromeWebUI { | 32 class ExtensionWebUI : public ChromeWebUI { |
| 33 public: | 33 public: |
| 34 static const char kExtensionURLOverrides[]; | 34 static const char kExtensionURLOverrides[]; |
| 35 | 35 |
| 36 ExtensionWebUI(TabContents* tab_contents, const GURL& url); | 36 ExtensionWebUI(TabContents* tab_contents, const GURL& url); |
| 37 | 37 |
| 38 virtual ~ExtensionWebUI(); | 38 virtual ~ExtensionWebUI(); |
| 39 | 39 |
| 40 virtual ExtensionBookmarkManagerEventRouter* | 40 virtual BookmarkManagerExtensionEventRouter* |
| 41 extension_bookmark_manager_event_router(); | 41 bookmark_manager_extension_event_router(); |
| 42 | 42 |
| 43 // BrowserURLHandler | 43 // BrowserURLHandler |
| 44 static bool HandleChromeURLOverride(GURL* url, | 44 static bool HandleChromeURLOverride(GURL* url, |
| 45 content::BrowserContext* browser_context); | 45 content::BrowserContext* browser_context); |
| 46 static bool HandleChromeURLOverrideReverse( | 46 static bool HandleChromeURLOverrideReverse( |
| 47 GURL* url, content::BrowserContext* browser_context); | 47 GURL* url, content::BrowserContext* browser_context); |
| 48 | 48 |
| 49 // Register and unregister a dictionary of one or more overrides. | 49 // Register and unregister a dictionary of one or more overrides. |
| 50 // Page names are the keys, and chrome-extension: URLs are the values. | 50 // Page names are the keys, and chrome-extension: URLs are the values. |
| 51 // (e.g. { "newtab": "chrome-extension://<id>/my_new_tab.html" } | 51 // (e.g. { "newtab": "chrome-extension://<id>/my_new_tab.html" } |
| (...skipping 16 matching lines...) Expand all Loading... |
| 68 private: | 68 private: |
| 69 // Unregister the specified override, and if it's the currently active one, | 69 // Unregister the specified override, and if it's the currently active one, |
| 70 // ensure that something takes its place. | 70 // ensure that something takes its place. |
| 71 static void UnregisterAndReplaceOverride(const std::string& page, | 71 static void UnregisterAndReplaceOverride(const std::string& page, |
| 72 Profile* profile, | 72 Profile* profile, |
| 73 base::ListValue* list, | 73 base::ListValue* list, |
| 74 base::Value* override); | 74 base::Value* override); |
| 75 | 75 |
| 76 // TODO(aa): This seems out of place. Why is it not with the event routers for | 76 // TODO(aa): This seems out of place. Why is it not with the event routers for |
| 77 // the other extension APIs? | 77 // the other extension APIs? |
| 78 scoped_ptr<ExtensionBookmarkManagerEventRouter> | 78 scoped_ptr<BookmarkManagerExtensionEventRouter> |
| 79 extension_bookmark_manager_event_router_; | 79 bookmark_manager_extension_event_router_; |
| 80 | 80 |
| 81 // The URL this WebUI was created for. | 81 // The URL this WebUI was created for. |
| 82 GURL url_; | 82 GURL url_; |
| 83 }; | 83 }; |
| 84 | 84 |
| 85 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_WEB_UI_H_ | 85 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_WEB_UI_H_ |
| OLD | NEW |