| 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 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |