Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 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 |
| 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 if (base::FeatureList::IsEnabled( | |
| 96 features::kMaterialDesignSettingsFeature)) { | |
| 97 // No rewrite in this case. | |
| 95 } else { | 98 } else { |
|
Dan Beam
2016/06/01 20:54:50
can't this just be:
} else if (!base::FeatureList
groby-ooo-7-16
2016/06/02 23:03:53
I kind of like explicitly calling out the alternat
| |
| 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 |
| 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)) { | |
|
Dan Beam
2016/06/01 20:54:50
same
groby-ooo-7-16
2016/06/02 23:03:53
Done.
| |
| 105 } else { | 110 } else { |
| 106 host = chrome::kChromeUIUberHost; | 111 host = chrome::kChromeUIUberHost; |
| 107 path = chrome::kChromeUIHelpHost + url->path(); | 112 path = chrome::kChromeUIHelpHost + url->path(); |
| 108 } | 113 } |
| 109 } | 114 } |
| 110 | 115 |
| 111 GURL::Replacements replacements; | 116 GURL::Replacements replacements; |
| 112 replacements.SetHostStr(host); | 117 replacements.SetHostStr(host); |
| 113 if (!path.empty()) | 118 if (!path.empty()) |
| 114 replacements.SetPathStr(path); | 119 replacements.SetPathStr(path); |
| (...skipping 13 matching lines...) Expand all Loading... | |
| 128 FROM_HERE, base::Bind(&chrome::AttemptRestart)); | 133 FROM_HERE, base::Bind(&chrome::AttemptRestart)); |
| 129 return true; | 134 return true; |
| 130 } else if (base::LowerCaseEqualsASCII(spec, chrome::kChromeUIQuitURL)) { | 135 } else if (base::LowerCaseEqualsASCII(spec, chrome::kChromeUIQuitURL)) { |
| 131 base::ThreadTaskRunnerHandle::Get()->PostTask( | 136 base::ThreadTaskRunnerHandle::Get()->PostTask( |
| 132 FROM_HERE, base::Bind(&chrome::AttemptExit)); | 137 FROM_HERE, base::Bind(&chrome::AttemptExit)); |
| 133 return true; | 138 return true; |
| 134 } | 139 } |
| 135 | 140 |
| 136 return false; | 141 return false; |
| 137 } | 142 } |
| OLD | NEW |