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

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

Issue 2029263002: [MD Settings] Add feature to enable md-settings by default. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Review fixes. 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
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 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 } else { 81 } else {
82 #if defined(OS_ANDROID) 82 #if defined(OS_ANDROID)
83 // On Android, redirect directly to chrome://history-frame since 83 // On Android, redirect directly to chrome://history-frame since
84 // uber page is unsupported. 84 // uber page is unsupported.
85 host = chrome::kChromeUIHistoryFrameHost; 85 host = chrome::kChromeUIHistoryFrameHost;
86 #else 86 #else
87 host = chrome::kChromeUIUberHost; 87 host = chrome::kChromeUIUberHost;
88 path = chrome::kChromeUIHistoryHost + url->path(); 88 path = chrome::kChromeUIHistoryHost + url->path();
89 #endif 89 #endif
90 } 90 }
91 // Redirect chrome://settings 91 // Redirect chrome://settings, unless MD settings is enabled.
92 } else if (host == chrome::kChromeUISettingsHost) { 92 } else if (host == chrome::kChromeUISettingsHost) {
93 if (::switches::AboutInSettingsEnabled()) { 93 if (::switches::AboutInSettingsEnabled()) {
94 host = chrome::kChromeUISettingsFrameHost; 94 host = chrome::kChromeUISettingsFrameHost;
95 } else { 95 } else if (!base::FeatureList::IsEnabled(
96 features::kMaterialDesignSettingsFeature)) {
96 host = chrome::kChromeUIUberHost; 97 host = chrome::kChromeUIUberHost;
97 path = chrome::kChromeUISettingsHost + url->path(); 98 path = chrome::kChromeUISettingsHost + url->path();
98 } 99 }
99 // Redirect chrome://help 100 // Redirect chrome://help, unless MD settings is enabled.
100 } else if (host == chrome::kChromeUIHelpHost) { 101 } else if (host == chrome::kChromeUIHelpHost) {
101 if (::switches::AboutInSettingsEnabled()) { 102 if (::switches::AboutInSettingsEnabled()) {
102 host = chrome::kChromeUISettingsFrameHost; 103 host = chrome::kChromeUISettingsFrameHost;
103 if (url->path().empty() || url->path() == "/") 104 if (url->path().empty() || url->path() == "/")
104 path = chrome::kChromeUIHelpHost; 105 path = chrome::kChromeUIHelpHost;
106 } else if (!base::FeatureList::IsEnabled(
107 features::kMaterialDesignSettingsFeature)) {
105 } else { 108 } else {
Dan Beam 2016/06/03 03:01:43 this } else { seems wrong
groby-ooo-7-16 2016/06/06 20:11:59 Sure does. Thanks for catching.
106 host = chrome::kChromeUIUberHost; 109 host = chrome::kChromeUIUberHost;
107 path = chrome::kChromeUIHelpHost + url->path(); 110 path = chrome::kChromeUIHelpHost + url->path();
108 } 111 }
109 } 112 }
110 113
111 GURL::Replacements replacements; 114 GURL::Replacements replacements;
112 replacements.SetHostStr(host); 115 replacements.SetHostStr(host);
113 if (!path.empty()) 116 if (!path.empty())
114 replacements.SetPathStr(path); 117 replacements.SetPathStr(path);
115 *url = url->ReplaceComponents(replacements); 118 *url = url->ReplaceComponents(replacements);
(...skipping 12 matching lines...) Expand all
128 FROM_HERE, base::Bind(&chrome::AttemptRestart)); 131 FROM_HERE, base::Bind(&chrome::AttemptRestart));
129 return true; 132 return true;
130 } else if (base::LowerCaseEqualsASCII(spec, chrome::kChromeUIQuitURL)) { 133 } else if (base::LowerCaseEqualsASCII(spec, chrome::kChromeUIQuitURL)) {
131 base::ThreadTaskRunnerHandle::Get()->PostTask( 134 base::ThreadTaskRunnerHandle::Get()->PostTask(
132 FROM_HERE, base::Bind(&chrome::AttemptExit)); 135 FROM_HERE, base::Bind(&chrome::AttemptExit));
133 return true; 136 return true;
134 } 137 }
135 138
136 return false; 139 return false;
137 } 140 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698