summaryrefslogtreecommitdiffstats
path: root/chrome/browser/extensions/extension_web_ui.h
diff options
context:
space:
mode:
authorasvitkine@chromium.org <asvitkine@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-05-06 17:49:41 +0000
committerasvitkine@chromium.org <asvitkine@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-05-06 17:49:41 +0000
commitf1eb87a8de3174473b44d24546a601fb5ab62c1a (patch)
tree8f975dda05cb654aef1675276a9573a20588becd /chrome/browser/extensions/extension_web_ui.h
parent6f916a1eba573a8c3331865d499cf32ded4fdaa8 (diff)
downloadchromium_src-f1eb87a8de3174473b44d24546a601fb5ab62c1a.zip
chromium_src-f1eb87a8de3174473b44d24546a601fb5ab62c1a.tar.gz
chromium_src-f1eb87a8de3174473b44d24546a601fb5ab62c1a.tar.bz2
Fix "chrome://bookmarks" URL not displaying in omnibox.
This change modifies the BrowserURLHandler to handle reverse mapping of the chrome-extension://.../ bookmark manager URL back to chrome://bookmarks. To do this, I've added functionality to the BrowserURLHandler to support reverse mapping even when there is no original URL. The previous system would only reverse remap if it was mapped earlier in the other direction from what the user had typed into the omnibox. This is not the case when the bookmark manager updates its URL by adding refs (#1, #12, etc) at the end of the URL string - which loses the original URL typed by the user. To support the above scenario, I've added new semantics to the BrowserURLHandler so that when the first handler (forward mapper) is NULL, it always tries the reverse remapper which should do the reverse mapping only if the URL matches one of its expectations. I've added ExtensionWebUI::HandleChromeURLOverrideReverse(), which is such a reverse mapper. Additionally, I've made BrowserURLHandler a singleton instead of a class with static methods for easier testing and added a couple of tests for it. Finally, there's a couple of other pieces of plumbing to make this work. BUG=37356 TEST=Go to the bookmark manager. chrome://bookmarks/ should be shown in the omnibox. Select a folder - this should change the URL to something like chrome://bookmarks/#5. Copy this URL and paste it back into the omnibox. You should be taken to the bookmarks manager with the same selection. Review URL: http://codereview.chromium.org/6904167 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@84464 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/extensions/extension_web_ui.h')
-rw-r--r--chrome/browser/extensions/extension_web_ui.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/chrome/browser/extensions/extension_web_ui.h b/chrome/browser/extensions/extension_web_ui.h
index ef7f5e9..3a3a80b 100644
--- a/chrome/browser/extensions/extension_web_ui.h
+++ b/chrome/browser/extensions/extension_web_ui.h
@@ -58,6 +58,7 @@ class ExtensionWebUI
// BrowserURLHandler
static bool HandleChromeURLOverride(GURL* url, Profile* profile);
+ static bool HandleChromeURLOverrideReverse(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.