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

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: One last fix... 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 | « chrome/browser/about_flags.cc ('k') | chrome/browser/profiles/profile_window.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 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()) {
Nico 2016/06/10 18:41:27 this looks a bit funny -- if i enable md settings
groby-ooo-7-16 2016/06/10 20:58:17 The two flags are mutually exclusive, so any combi
94 host = chrome::kChromeUISettingsFrameHost; 94 host = chrome::kChromeUISettingsFrameHost;
95 } else if (base::FeatureList::IsEnabled(
96 features::kMaterialDesignSettingsFeature)) {
97 return true; // Prevent further rewriting - this is a valid URL.
95 } else { 98 } else {
96 host = chrome::kChromeUIUberHost; 99 host = chrome::kChromeUIUberHost;
97 path = chrome::kChromeUISettingsHost + url->path(); 100 path = chrome::kChromeUISettingsHost + url->path();
98 } 101 }
99 // Redirect chrome://help 102 // Redirect chrome://help, unless MD settings is enabled.
100 } else if (host == chrome::kChromeUIHelpHost) { 103 } else if (host == chrome::kChromeUIHelpHost) {
101 if (::switches::AboutInSettingsEnabled()) { 104 if (::switches::AboutInSettingsEnabled()) {
102 host = chrome::kChromeUISettingsFrameHost; 105 host = chrome::kChromeUISettingsFrameHost;
103 if (url->path().empty() || url->path() == "/") 106 if (url->path().empty() || url->path() == "/")
104 path = chrome::kChromeUIHelpHost; 107 path = chrome::kChromeUIHelpHost;
108 } else if (base::FeatureList::IsEnabled(
109 features::kMaterialDesignSettingsFeature)) {
110 return true; // Prevent further rewriting - this is a valid URL.
105 } else { 111 } else {
106 host = chrome::kChromeUIUberHost; 112 host = chrome::kChromeUIUberHost;
107 path = chrome::kChromeUIHelpHost + url->path(); 113 path = chrome::kChromeUIHelpHost + url->path();
108 } 114 }
109 } 115 }
110 116
111 GURL::Replacements replacements; 117 GURL::Replacements replacements;
112 replacements.SetHostStr(host); 118 replacements.SetHostStr(host);
113 if (!path.empty()) 119 if (!path.empty())
114 replacements.SetPathStr(path); 120 replacements.SetPathStr(path);
(...skipping 13 matching lines...) Expand all
128 FROM_HERE, base::Bind(&chrome::AttemptRestart)); 134 FROM_HERE, base::Bind(&chrome::AttemptRestart));
129 return true; 135 return true;
130 } else if (base::LowerCaseEqualsASCII(spec, chrome::kChromeUIQuitURL)) { 136 } else if (base::LowerCaseEqualsASCII(spec, chrome::kChromeUIQuitURL)) {
131 base::ThreadTaskRunnerHandle::Get()->PostTask( 137 base::ThreadTaskRunnerHandle::Get()->PostTask(
132 FROM_HERE, base::Bind(&chrome::AttemptExit)); 138 FROM_HERE, base::Bind(&chrome::AttemptExit));
133 return true; 139 return true;
134 } 140 }
135 141
136 return false; 142 return false;
137 } 143 }
OLDNEW
« no previous file with comments | « chrome/browser/about_flags.cc ('k') | chrome/browser/profiles/profile_window.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698