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

Unified Diff: chrome/browser/browser_about_handler.cc

Issue 5315006: chromeos: Fix DOMUI about:credits link. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/chrome
Patch Set: abstract out AboutSource init code from WillHandleBrowserAboutURL Created 10 years 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/browser_about_handler.h ('k') | chrome/browser/dom_ui/options/about_page_handler.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 715f46070b1d1528ac4ea74c203f53d9002334fe..f5c9de84ca04242c14854fff0cc5807fe2cdf0e5 100644
--- a/chrome/browser/browser_about_handler.cc
+++ b/chrome/browser/browser_about_handler.cc
@@ -1078,14 +1078,8 @@ bool WillHandleBrowserAboutURL(GURL* url, Profile* profile) {
if (chrome_about_handler::WillHandle(*url))
return false;
- // Anything else requires our special handler, make sure its initialized.
- // We only need to register the AboutSource once and it is kept globally.
- // There is currently no way to remove a data source.
- static bool initialized = false;
- if (!initialized) {
- about_source = new AboutSource();
- initialized = true;
- }
+ // Anything else requires our special handler; make sure it's initialized.
+ InitializeAboutDataSource();
// Special case about:memory to go through a redirect before ending up on
// the final page. See GetAboutMemoryRedirectResponse above for why.
@@ -1103,6 +1097,16 @@ bool WillHandleBrowserAboutURL(GURL* url, Profile* profile) {
return true;
}
+void InitializeAboutDataSource() {
+ // We only need to register the AboutSource once and it is kept globally.
+ // There is currently no way to remove a data source.
+ static bool initialized = false;
+ if (!initialized) {
+ about_source = new AboutSource();
+ initialized = true;
+ }
+}
+
// This function gets called with the fixed-up chrome: URLs, so we have to
// compare against those instead of "about:blah".
bool HandleNonNavigationAboutURL(const GURL& url) {
« no previous file with comments | « chrome/browser/browser_about_handler.h ('k') | chrome/browser/dom_ui/options/about_page_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698