| 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 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 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| 11 #include "chrome/browser/bookmarks/bookmark_manager_extension_api.h" | 11 #include "chrome/browser/bookmarks/bookmark_manager_extension_api.h" |
| 12 #include "chrome/browser/favicon/favicon_service.h" | 12 #include "chrome/browser/favicon/favicon_service.h" |
| 13 #include "chrome/common/extensions/extension.h" | 13 #include "chrome/common/extensions/api/url_overrides/url_overrides_handler.h" |
| 14 #include "content/public/browser/web_ui_controller.h" | 14 #include "content/public/browser/web_ui_controller.h" |
| 15 | 15 |
| 16 namespace content { | 16 namespace content { |
| 17 class WebContents; | 17 class WebContents; |
| 18 } | 18 } |
| 19 | 19 |
| 20 class PrefService; | 20 class PrefService; |
| 21 class Profile; | 21 class Profile; |
| 22 | 22 |
| 23 // This class implements WebUI for extensions and allows extensions to put UI in | 23 // This class implements WebUI for extensions and allows extensions to put UI in |
| (...skipping 14 matching lines...) Expand all Loading... |
| 38 // BrowserURLHandler | 38 // BrowserURLHandler |
| 39 static bool HandleChromeURLOverride(GURL* url, | 39 static bool HandleChromeURLOverride(GURL* url, |
| 40 content::BrowserContext* browser_context); | 40 content::BrowserContext* browser_context); |
| 41 static bool HandleChromeURLOverrideReverse( | 41 static bool HandleChromeURLOverrideReverse( |
| 42 GURL* url, content::BrowserContext* browser_context); | 42 GURL* url, content::BrowserContext* browser_context); |
| 43 | 43 |
| 44 // Register and unregister a dictionary of one or more overrides. | 44 // Register and unregister a dictionary of one or more overrides. |
| 45 // Page names are the keys, and chrome-extension: URLs are the values. | 45 // Page names are the keys, and chrome-extension: URLs are the values. |
| 46 // (e.g. { "newtab": "chrome-extension://<id>/my_new_tab.html" } | 46 // (e.g. { "newtab": "chrome-extension://<id>/my_new_tab.html" } |
| 47 static void RegisterChromeURLOverrides(Profile* profile, | 47 static void RegisterChromeURLOverrides(Profile* profile, |
| 48 const extensions::Extension::URLOverrideMap& overrides); | 48 const extensions::URLOverridesInfo::URLOverrideMap& overrides); |
| 49 static void UnregisterChromeURLOverrides(Profile* profile, | 49 static void UnregisterChromeURLOverrides(Profile* profile, |
| 50 const extensions::Extension::URLOverrideMap& overrides); | 50 const extensions::URLOverridesInfo::URLOverrideMap& overrides); |
| 51 static void UnregisterChromeURLOverride(const std::string& page, | 51 static void UnregisterChromeURLOverride(const std::string& page, |
| 52 Profile* profile, | 52 Profile* profile, |
| 53 const base::Value* override); | 53 const base::Value* override); |
| 54 | 54 |
| 55 // Called from BrowserPrefs | 55 // Called from BrowserPrefs |
| 56 static void RegisterUserPrefs(PrefService* prefs); | 56 static void RegisterUserPrefs(PrefService* prefs); |
| 57 | 57 |
| 58 // Get the favicon for the extension by getting an icon from the manifest. | 58 // Get the favicon for the extension by getting an icon from the manifest. |
| 59 // Note. |callback| is always run asynchronously. | 59 // Note. |callback| is always run asynchronously. |
| 60 static void GetFaviconForURL( | 60 static void GetFaviconForURL( |
| (...skipping 12 matching lines...) Expand all Loading... |
| 73 // TODO(aa): This seems out of place. Why is it not with the event routers for | 73 // TODO(aa): This seems out of place. Why is it not with the event routers for |
| 74 // the other extension APIs? | 74 // the other extension APIs? |
| 75 scoped_ptr<BookmarkManagerExtensionEventRouter> | 75 scoped_ptr<BookmarkManagerExtensionEventRouter> |
| 76 bookmark_manager_extension_event_router_; | 76 bookmark_manager_extension_event_router_; |
| 77 | 77 |
| 78 // The URL this WebUI was created for. | 78 // The URL this WebUI was created for. |
| 79 GURL url_; | 79 GURL url_; |
| 80 }; | 80 }; |
| 81 | 81 |
| 82 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_WEB_UI_H_ | 82 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_WEB_UI_H_ |
| OLD | NEW |