Chromium Code Reviews| Index: chrome/browser/ssl/ssl_blocking_page.cc |
| diff --git a/chrome/browser/ssl/ssl_blocking_page.cc b/chrome/browser/ssl/ssl_blocking_page.cc |
| index ca97c2b60a0a90009235bd3716fc0b3b657f2126..c726397a23ae201ae27096d20f5125a3c8388484 100644 |
| --- a/chrome/browser/ssl/ssl_blocking_page.cc |
| +++ b/chrome/browser/ssl/ssl_blocking_page.cc |
| @@ -10,6 +10,7 @@ |
| #include "base/i18n/time_formatting.h" |
| #include "base/metrics/field_trial.h" |
| #include "base/metrics/histogram.h" |
| +#include "base/process/launch.h" |
| #include "base/strings/string_number_conversions.h" |
| #include "base/strings/string_piece.h" |
| #include "base/strings/stringprintf.h" |
| @@ -51,9 +52,16 @@ |
| #endif |
| #if defined(OS_WIN) |
| +#include "base/base_paths_win.h" |
| +#include "base/path_service.h" |
| #include "base/win/windows_version.h" |
| #endif |
| +#if defined(OS_CHROMEOS) |
| +#include "chrome/browser/profiles/profile_manager.h" |
| +#include "chrome/common/url_constants.h" |
| +#endif |
| + |
| using base::ASCIIToUTF16; |
| using base::TimeTicks; |
| using content::InterstitialPage; |
| @@ -216,6 +224,48 @@ void RecordSSLBlockingPageDetailedStats( |
| } |
| } |
| +void LaunchDateAndTimeSettings() { |
| +#if defined(OS_CHROMEOS) |
| + std::string sub_page = std::string(chrome::kSearchSubPage) + "#" + |
| + l10n_util::GetStringUTF8(IDS_OPTIONS_SETTINGS_SECTION_TITLE_DATETIME); |
| + chrome::ShowSettingsSubPageForProfile( |
| + ProfileManager::GetActiveUserProfile(), sub_page); |
| + return; |
| +#elif defined(OS_ANDROID) |
| + CommandLine command(base::FilePath("/system/bin/am")); |
| + command.AppendArg("start"); |
| + command.AppendArg( |
| + "'com.android.settings/.Settings$DateTimeSettingsActivity'"); |
| +#elif defined(OS_IOS) |
| + // TODO(palmer) |
| + return; |
| +#elif defined(OS_LINUX) |
| + CommandLine command(base::FilePath("/usr/bin/gnome-control-center")); |
| + // NOTE: On old Ubuntu, naming control panels doesn't work, so it |
| + // opens the overview. This will have to be good enough. |
| + command.AppendArg("datetime"); |
| + // |
| + // TODO(palmer): Provide an option for KDE, et c. |
| +#elif defined(OS_MACOSX) |
| + CommandLine command(base::FilePath("/usr/bin/open")); |
| + command.AppendArg("/System/Library/PreferencePanes/DateAndTime.prefPane"); |
| +#elif defined(OS_WIN) |
| + base::FilePath path; |
| + PathService::Get(base::DIR_SYSTEM, &path); |
| + path = path.Append(std::wstring(L"control.exe")); |
| + CommandLine command(path); |
| + command.AppendArg(std::string("/name")); |
| + command.AppendArg(std::string("Microsoft.DateAndTime")); |
| +#else |
| + return; |
| +#endif |
| + |
| + VLOG(1) << "Running " << command.GetCommandLineString(); |
| + base::LaunchOptions options; |
|
Robert Sesek
2014/07/16 13:52:52
You may need to set allow_new_privs = true on Linu
|
| + options.wait = false; |
| + base::LaunchProcess(command, options, NULL); |
| +} |
| + |
| } // namespace |
| // Note that we always create a navigation entry with SSL errors. |
| @@ -611,9 +661,7 @@ void SSLBlockingPage::CommandReceived(const std::string& command) { |
| break; |
| } |
| case CMD_CLOCK: { |
| - content::NavigationController::LoadURLParams help_page_params(GURL( |
| - "https://support.google.com/chrome/?p=ui_system_clock")); |
| - web_contents_->GetController().LoadURLWithParams(help_page_params); |
| + LaunchDateAndTimeSettings(); |
| break; |
| } |
| default: { |