Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1043)

Unified Diff: chrome/browser/extensions/extension_dom_ui.h

Issue 174277: override chrome:// URLs via extensions. (Closed)
Patch Set: fix linux errors Created 11 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/extensions/extension_browsertest.cc ('k') | chrome/browser/extensions/extension_dom_ui.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/extension_dom_ui.h
diff --git a/chrome/browser/extensions/extension_dom_ui.h b/chrome/browser/extensions/extension_dom_ui.h
index ff64a9d07b25da5f78ffb2094127cbd5982f4efc..b8ef8dc4ea652bf5c8f3e4ab320ffaa9f7b02999 100644
--- a/chrome/browser/extensions/extension_dom_ui.h
+++ b/chrome/browser/extensions/extension_dom_ui.h
@@ -9,6 +9,10 @@
#include "chrome/browser/dom_ui/dom_ui.h"
#include "chrome/browser/extensions/extension_function_dispatcher.h"
+class ListValue;
+class PrefService;
+class TabContents;
+
// This class implements DOMUI for extensions and allows extensions to put UI in
// the main tab contents area.
class ExtensionDOMUI
@@ -16,6 +20,7 @@ class ExtensionDOMUI
public ExtensionFunctionDispatcher::Delegate {
public:
explicit ExtensionDOMUI(TabContents* tab_contents);
+
ExtensionFunctionDispatcher* extension_function_dispatcher() const {
return extension_function_dispatcher_.get();
}
@@ -31,7 +36,36 @@ class ExtensionDOMUI
// ExtensionFunctionDispatcher::Delegate
virtual Browser* GetBrowser();
+ // BrowserURLHandler
+ static bool HandleChromeURLOverride(GURL* url, Profile* profile);
+
+ // Register and unregister a dictionary of one or more overrides.
+ // Page names are the keys, and chrome-extension: URLs are the values.
+ // (e.g. { "newtab": "chrome-extension://<id>/my_new_tab.html" }
+ static void RegisterChromeURLOverrides(Profile* profile,
+ const DictionaryValue* overrides);
+ static void UnregisterChromeURLOverrides(Profile* profile,
+ const DictionaryValue* overrides);
+ static void UnregisterChromeURLOverride(const std::string& page,
+ Profile* profile,
+ Value* override);
+
+ // Called from BrowserPrefs
+ static void RegisterUserPrefs(PrefService* prefs);
+
private:
+ // Unregister the specified override, and if it's the currently active one,
+ // ensure that something takes its place.
+ static void UnregisterAndReplaceOverride(const std::string& page,
+ Profile* profile,
+ ListValue* list,
+ Value* override);
+
+ // When the RenderViewHost changes (RenderViewCreated and RenderViewReused),
+ // we need to reset the ExtensionFunctionDispatcher so it's talking to the
+ // right one, as well as being linked to the correct URL.
+ void ResetExtensionFunctionDispatcher(RenderViewHost* render_view_host);
+
scoped_ptr<ExtensionFunctionDispatcher> extension_function_dispatcher_;
};
« no previous file with comments | « chrome/browser/extensions/extension_browsertest.cc ('k') | chrome/browser/extensions/extension_dom_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698