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

Side by Side Diff: chrome/browser/browser_about_handler.cc

Issue 2095043004: Fix material Help page redirect, again (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: #YOLO Created 4 years, 6 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 unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/browser_about_handler_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/browser_about_handler.h" 5 #include "chrome/browser/browser_about_handler.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/location.h" 10 #include "base/location.h"
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 } else if (::switches::AboutInSettingsEnabled()) { 101 } else if (::switches::AboutInSettingsEnabled()) {
102 host = chrome::kChromeUISettingsFrameHost; 102 host = chrome::kChromeUISettingsFrameHost;
103 } else { 103 } else {
104 host = chrome::kChromeUIUberHost; 104 host = chrome::kChromeUIUberHost;
105 path = chrome::kChromeUISettingsHost + url->path(); 105 path = chrome::kChromeUISettingsHost + url->path();
106 } 106 }
107 // Redirect chrome://help, unless MD settings is enabled. 107 // Redirect chrome://help, unless MD settings is enabled.
108 } else if (host == chrome::kChromeUIHelpHost) { 108 } else if (host == chrome::kChromeUIHelpHost) {
109 if (base::FeatureList::IsEnabled( 109 if (base::FeatureList::IsEnabled(
110 features::kMaterialDesignSettingsFeature)) { 110 features::kMaterialDesignSettingsFeature)) {
111 return true; // Prevent further rewriting - this is a valid URL. 111 host = chrome::kChromeUISettingsHost;
112 path = chrome::kChromeUIHelpHost;
112 } else if (::switches::AboutInSettingsEnabled()) { 113 } else if (::switches::AboutInSettingsEnabled()) {
113 host = chrome::kChromeUISettingsFrameHost; 114 host = chrome::kChromeUISettingsFrameHost;
114 if (url->path().empty() || url->path() == "/") 115 if (url->path().empty() || url->path() == "/")
115 path = chrome::kChromeUIHelpHost; 116 path = chrome::kChromeUIHelpHost;
116 } else { 117 } else {
117 host = chrome::kChromeUIUberHost; 118 host = chrome::kChromeUIUberHost;
118 path = chrome::kChromeUIHelpHost + url->path(); 119 path = chrome::kChromeUIHelpHost + url->path();
119 } 120 }
120 } 121 }
121 122
(...skipping 17 matching lines...) Expand all
139 FROM_HERE, base::Bind(&chrome::AttemptRestart)); 140 FROM_HERE, base::Bind(&chrome::AttemptRestart));
140 return true; 141 return true;
141 } else if (base::LowerCaseEqualsASCII(spec, chrome::kChromeUIQuitURL)) { 142 } else if (base::LowerCaseEqualsASCII(spec, chrome::kChromeUIQuitURL)) {
142 base::ThreadTaskRunnerHandle::Get()->PostTask( 143 base::ThreadTaskRunnerHandle::Get()->PostTask(
143 FROM_HERE, base::Bind(&chrome::AttemptExit)); 144 FROM_HERE, base::Bind(&chrome::AttemptExit));
144 return true; 145 return true;
145 } 146 }
146 147
147 return false; 148 return false;
148 } 149 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/browser_about_handler_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698