| Index: chrome/browser/ui/startup/startup_browser_creator.cc
|
| diff --git a/chrome/browser/ui/startup/startup_browser_creator.cc b/chrome/browser/ui/startup/startup_browser_creator.cc
|
| index c5bce5454100fbf3e3056f8bd17d69b938804cb3..4afb965573a936ca12eaedf743a32d6fc9a0db42 100644
|
| --- a/chrome/browser/ui/startup/startup_browser_creator.cc
|
| +++ b/chrome/browser/ui/startup/startup_browser_creator.cc
|
| @@ -56,6 +56,7 @@
|
| #include "chrome/browser/ui/browser_window.h"
|
| #include "chrome/browser/ui/startup/startup_browser_creator_impl.h"
|
| #include "chrome/browser/ui/user_manager.h"
|
| +#include "chrome/browser/ui/webui/options/reset_profile_settings_handler.h"
|
| #include "chrome/common/chrome_constants.h"
|
| #include "chrome/common/chrome_paths.h"
|
| #include "chrome/common/chrome_result_codes.h"
|
| @@ -521,22 +522,34 @@ std::vector<GURL> StartupBrowserCreator::GetURLsFromCommandLine(
|
| if (!url.is_valid())
|
| continue;
|
|
|
| + const GURL settings_url = GURL(chrome::kChromeUISettingsURL);
|
| + bool url_points_to_an_approved_settings_page = false;
|
| +#if defined(OS_CHROMEOS)
|
| + // In ChromeOS, allow any settings page to be specified on the command line.
|
| + url_points_to_an_approved_settings_page =
|
| + url.GetOrigin() == settings_url.GetOrigin();
|
| +#else
|
| + // Exposed for external cleaners to offer a settings reset to the
|
| + // user. The allowed URLs must match exactly.
|
| + const GURL reset_settings_url =
|
| + settings_url.Resolve(chrome::kResetProfileSettingsSubPage);
|
| + url_points_to_an_approved_settings_page = url == reset_settings_url;
|
| +#if defined(OS_WIN)
|
| + // On Windows, also allow a hash for the Chrome Cleanup Tool.
|
| + const GURL reset_settings_url_with_cct_hash = reset_settings_url.Resolve(
|
| + std::string("#") +
|
| + options::ResetProfileSettingsHandler::kCctResetSettingsHash);
|
| + url_points_to_an_approved_settings_page =
|
| + url_points_to_an_approved_settings_page ||
|
| + url == reset_settings_url_with_cct_hash;
|
| +#endif // defined(OS_WIN)
|
| +#endif // defined(OS_CHROMEOS)
|
| +
|
| ChildProcessSecurityPolicy* policy =
|
| ChildProcessSecurityPolicy::GetInstance();
|
| if (policy->IsWebSafeScheme(url.scheme()) ||
|
| url.SchemeIs(url::kFileScheme) ||
|
| -#if defined(OS_CHROMEOS)
|
| - // In ChromeOS, allow any settings page to be specified on the command
|
| - // line. See ExistingUserController::OnLoginSuccess.
|
| - base::StartsWith(url.spec(), chrome::kChromeUISettingsURL,
|
| - base::CompareCase::SENSITIVE) ||
|
| -#else
|
| - // Exposed for external cleaners to offer a settings reset to the
|
| - // user. So the URL must match exactly, without any param or prefix.
|
| - (url.spec() ==
|
| - std::string(chrome::kChromeUISettingsURL) +
|
| - chrome::kResetProfileSettingsSubPage) ||
|
| -#endif
|
| + url_points_to_an_approved_settings_page ||
|
| (url.spec().compare(url::kAboutBlankURL) == 0)) {
|
| urls.push_back(url);
|
| }
|
|
|