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

Unified Diff: chrome/browser/browser_about_handler.cc

Issue 3152055: Implement about:labs (Closed)
Patch Set: chromeos fix Created 10 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/app_controller_mac.mm ('k') | chrome/browser/browser_main.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/browser_about_handler.cc
diff --git a/chrome/browser/browser_about_handler.cc b/chrome/browser/browser_about_handler.cc
index 25e288d45669a75f7bcfe7fcfe9e1bf1519d5145..4599689063944c36360a69fc4ddfafeb294944b2 100644
--- a/chrome/browser/browser_about_handler.cc
+++ b/chrome/browser/browser_about_handler.cc
@@ -29,6 +29,7 @@
#include "chrome/browser/chrome_thread.h"
#include "chrome/browser/defaults.h"
#include "chrome/browser/dom_ui/chrome_url_data_manager.h"
+#include "chrome/browser/labs.h"
#include "chrome/browser/memory_details.h"
#include "chrome/browser/metrics/histogram_synchronizer.h"
#include "chrome/browser/net/predictor_api.h"
@@ -96,6 +97,7 @@ const char kCreditsPath[] = "credits";
const char kCachePath[] = "view-http-cache";
const char kDnsPath[] = "dns";
const char kHistogramsPath[] = "histograms";
+const char kLabsPath[] = "labs";
const char kMemoryRedirectPath[] = "memory-redirect";
const char kMemoryPath[] = "memory";
const char kStatsPath[] = "stats";
@@ -127,6 +129,7 @@ const char *kAllAboutPaths[] = {
kCreditsPath,
kDnsPath,
kHistogramsPath,
+ kLabsPath,
kMemoryPath,
kNetInternalsPath,
kPluginsPath,
@@ -250,13 +253,17 @@ std::string AboutAbout() {
html.append("<html><head><title>About Pages</title></head><body>\n");
html.append("<h2>List of About pages</h2><ul>\n");
for (size_t i = 0; i < arraysize(kAllAboutPaths); i++) {
- if (kAllAboutPaths[i] == kNetInternalsPath ||
- kAllAboutPaths[i] == kPluginsPath ||
+ if (kAllAboutPaths[i] == kLabsPath && !about_labs::IsEnabled())
+ continue;
+ if (kAllAboutPaths[i] == kAppCacheInternalsPath ||
kAllAboutPaths[i] == kCachePath ||
- kAllAboutPaths[i] == kAppCacheInternalsPath)
+ kAllAboutPaths[i] == kLabsPath ||
+ kAllAboutPaths[i] == kNetInternalsPath ||
+ kAllAboutPaths[i] == kPluginsPath) {
html.append("<li><a href='chrome://");
- else
+ } else {
html.append("<li><a href='chrome://about/");
+ }
html.append(kAllAboutPaths[i]);
html.append("/'>about:");
html.append(kAllAboutPaths[i]);
@@ -1125,6 +1132,15 @@ bool WillHandleBrowserAboutURL(GURL* url, Profile* profile) {
return true;
}
+ if (about_labs::IsEnabled()) {
+ // Rewrite about:labs and about:vaporware to chrome://labs/.
+ if (LowerCaseEqualsASCII(url->spec(), chrome::kAboutLabsURL) ||
+ LowerCaseEqualsASCII(url->spec(), chrome::kAboutVaporwareURL)) {
+ *url = GURL(chrome::kChromeUILabsURL);
+ return true;
+ }
+ }
+
// Rewrite about:net-internals/* URLs to chrome://net-internals/*
if (StartsWithAboutSpecifier(*url, chrome::kAboutNetInternalsURL)) {
*url = RemapAboutURL(chrome::kNetworkViewInternalsURL, *url);
« no previous file with comments | « chrome/browser/app_controller_mac.mm ('k') | chrome/browser/browser_main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698