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