summaryrefslogtreecommitdiffstats
path: root/chrome/browser/browser_about_handler.cc
diff options
context:
space:
mode:
authorpkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-02-10 18:06:29 +0000
committerpkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-02-10 18:06:29 +0000
commit2c2e8ca578ba1ce7f01d9a88f7ee859af11ebba6 (patch)
tree4e6e8524c7222978e0e3aae72384f84566a81f2f /chrome/browser/browser_about_handler.cc
parent23538fad21c3738a81d9db9458dce2faead437d7 (diff)
downloadchromium_src-2c2e8ca578ba1ce7f01d9a88f7ee859af11ebba6.zip
chromium_src-2c2e8ca578ba1ce7f01d9a88f7ee859af11ebba6.tar.gz
chromium_src-2c2e8ca578ba1ce7f01d9a88f7ee859af11ebba6.tar.bz2
Revert 74451 - Add autocomplete provider for "about:" URLs. Original patch by simonmorris@chromium.org (see http://codereview.chromium.org/6246016/ ), r=me.
BUG=6870 TEST=Typing "about:s" into the omnibox should result in a couple of "about:s..." URL entries in the dropdown even if you've never visited them. TBR=pkasting@chromium.org Review URL: http://codereview.chromium.org/6485004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@74454 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/browser_about_handler.cc')
-rw-r--r--chrome/browser/browser_about_handler.cc53
1 files changed, 18 insertions, 35 deletions
diff --git a/chrome/browser/browser_about_handler.cc b/chrome/browser/browser_about_handler.cc
index eb08762..c4747d9 100644
--- a/chrome/browser/browser_about_handler.cc
+++ b/chrome/browser/browser_about_handler.cc
@@ -131,7 +131,6 @@ const char kOSCreditsPath[] = "os-credits";
// Add path here to be included in about:about
const char *kAllAboutPaths[] = {
- kAboutPath,
kAppCacheInternalsPath,
kBlobInternalsPath,
kCachePath,
@@ -260,13 +259,24 @@ std::string AboutAbout() {
std::string html;
html.append("<html><head><title>About Pages</title></head><body>\n");
html.append("<h2>List of About pages</h2><ul>\n");
- std::vector<std::string> paths = AboutPaths();
- for (std::vector<std::string>::const_iterator path = paths.begin();
- path != paths.end(); ++path) {
- html.append("<li><a href='");
- html.append(AboutPathToURL(*path).spec());
- html.append("'>about:");
- html.append(*path);
+ for (size_t i = 0; i < arraysize(kAllAboutPaths); i++) {
+ if (kAllAboutPaths[i] == kAppCacheInternalsPath ||
+ kAllAboutPaths[i] == kBlobInternalsPath ||
+ kAllAboutPaths[i] == kCachePath ||
+#if defined(OS_WIN)
+ kAllAboutPaths[i] == kConflictsPath ||
+#endif
+ kAllAboutPaths[i] == kFlagsPath ||
+ kAllAboutPaths[i] == kGpuPath ||
+ kAllAboutPaths[i] == kNetInternalsPath ||
+ kAllAboutPaths[i] == kPluginsPath) {
+ html.append("<li><a href='chrome://");
+ } else {
+ html.append("<li><a href='chrome://about/");
+ }
+ html.append(kAllAboutPaths[i]);
+ html.append("/'>about:");
+ html.append(kAllAboutPaths[i]);
html.append("</a>\n");
}
const char *debug[] = { "crash", "kill", "hang", "shorthang",
@@ -1069,30 +1079,3 @@ bool HandleNonNavigationAboutURL(const GURL& url) {
return false;
}
-
-std::vector<std::string> AboutPaths() {
- std::vector<std::string> paths;
- paths.reserve(arraysize(kAllAboutPaths));
- for (size_t i = 0; i < arraysize(kAllAboutPaths); i++)
- paths.push_back(kAllAboutPaths[i]);
- return paths;
-}
-
-GURL AboutPathToURL(const std::string& path) {
- InitializeAboutDataSource();
- if (LowerCaseEqualsASCII(path, kAppCacheInternalsPath) ||
- LowerCaseEqualsASCII(path, kBlobInternalsPath) ||
- LowerCaseEqualsASCII(path, kCachePath) ||
-#if defined(OS_WIN)
- LowerCaseEqualsASCII(path, kConflictsPath) ||
-#endif
- LowerCaseEqualsASCII(path, kFlagsPath) ||
- LowerCaseEqualsASCII(path, kGpuPath) ||
- LowerCaseEqualsASCII(path, kNetInternalsPath) ||
- LowerCaseEqualsASCII(path, kPluginsPath)) {
- return GURL(std::string("chrome://") + std::string(path) +
- std::string("/"));
- }
- return GURL(std::string("chrome://about/") + std::string(path) +
- std::string("/"));
-}