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/ssl/ssl_blocking_page.h" | 5 #include "chrome/browser/ssl/ssl_blocking_page.h" |
6 | 6 |
7 #include "base/build_time.h" | 7 #include "base/build_time.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/i18n/rtl.h" | 9 #include "base/i18n/rtl.h" |
10 #include "base/i18n/time_formatting.h" | 10 #include "base/i18n/time_formatting.h" |
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
226 chrome::ShowSettingsSubPageForProfile( | 226 chrome::ShowSettingsSubPageForProfile( |
227 ProfileManager::GetActiveUserProfile(), sub_page); | 227 ProfileManager::GetActiveUserProfile(), sub_page); |
228 return; | 228 return; |
229 #elif defined(OS_ANDROID) | 229 #elif defined(OS_ANDROID) |
230 CommandLine command(base::FilePath("/system/bin/am")); | 230 CommandLine command(base::FilePath("/system/bin/am")); |
231 command.AppendArg("start"); | 231 command.AppendArg("start"); |
232 command.AppendArg( | 232 command.AppendArg( |
233 "'com.android.settings/.Settings$DateTimeSettingsActivity'"); | 233 "'com.android.settings/.Settings$DateTimeSettingsActivity'"); |
234 #elif defined(OS_IOS) | 234 #elif defined(OS_IOS) |
235 // iOS does not have a way to launch the date and time settings. | 235 // iOS does not have a way to launch the date and time settings. |
236 return; | 236 NOTREACHED(); |
237 #elif defined(OS_LINUX) | 237 #elif defined(OS_LINUX) |
238 struct ClockCommand { | 238 struct ClockCommand { |
239 const char* pathname; | 239 const char* pathname; |
240 const char* argument; | 240 const char* argument; |
241 }; | 241 }; |
242 static const ClockCommand kClockCommands[] = { | 242 static const ClockCommand kClockCommands[] = { |
243 // Unity | 243 // Unity |
244 { "/usr/bin/unity-control-center", "datetime" }, | 244 { "/usr/bin/unity-control-center", "datetime" }, |
245 // GNOME | 245 // GNOME |
246 // | 246 // |
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
425 | 425 |
426 base::Time now = base::Time::NowFromSystemTime(); | 426 base::Time now = base::Time::NowFromSystemTime(); |
427 bool bad_clock = IsErrorDueToBadClock(now, cert_error_); | 427 bool bad_clock = IsErrorDueToBadClock(now, cert_error_); |
428 | 428 |
429 load_time_data.SetString("errorCode", net::ErrorToString(cert_error_)); | 429 load_time_data.SetString("errorCode", net::ErrorToString(cert_error_)); |
430 | 430 |
431 if (bad_clock) { | 431 if (bad_clock) { |
432 load_time_data.SetBoolean("bad_clock", true); | 432 load_time_data.SetBoolean("bad_clock", true); |
433 load_time_data.SetBoolean("overridable", false); | 433 load_time_data.SetBoolean("overridable", false); |
434 | 434 |
435 #if defined(OS_IOS) | |
felt
2014/11/04 02:42:53
this is gnarly, but I don't know a better way to d
| |
436 load_time_data.SetBoolean("hide_primary_button", true); | |
437 #else | |
438 load_time_data.SetBoolean("hide_primary_button", false); | |
439 #endif | |
440 | |
435 // We're showing the SSL clock warning to be helpful, but we haven't warned | 441 // We're showing the SSL clock warning to be helpful, but we haven't warned |
436 // them about the risks. (And there might still be an SSL error after they | 442 // them about the risks. (And there might still be an SSL error after they |
437 // fix their clock.) Thus, we don't allow the "danger" override in this | 443 // fix their clock.) Thus, we don't allow the "danger" override in this |
438 // case. | 444 // case. |
439 danger_overridable_ = false; | 445 danger_overridable_ = false; |
440 | 446 |
441 int heading_string = SSLErrorClassification::IsUserClockInTheFuture(now) ? | 447 int heading_string = SSLErrorClassification::IsUserClockInTheFuture(now) ? |
442 IDS_SSL_V2_CLOCK_AHEAD_HEADING : | 448 IDS_SSL_V2_CLOCK_AHEAD_HEADING : |
443 IDS_SSL_V2_CLOCK_BEHIND_HEADING; | 449 IDS_SSL_V2_CLOCK_BEHIND_HEADING; |
444 | 450 |
445 load_time_data.SetString( | 451 load_time_data.SetString( |
446 "tabTitle", | 452 "tabTitle", |
447 l10n_util::GetStringUTF16(IDS_SSL_V2_CLOCK_TITLE)); | 453 l10n_util::GetStringUTF16(IDS_SSL_V2_CLOCK_TITLE)); |
448 load_time_data.SetString( | 454 load_time_data.SetString( |
449 "heading", | 455 "heading", |
450 l10n_util::GetStringUTF16(heading_string)); | 456 l10n_util::GetStringUTF16(heading_string)); |
451 load_time_data.SetString("primaryParagraph", | 457 load_time_data.SetString("primaryParagraph", |
452 l10n_util::GetStringFUTF16( | 458 l10n_util::GetStringFUTF16( |
453 IDS_SSL_V2_CLOCK_PRIMARY_PARAGRAPH , | 459 IDS_SSL_V2_CLOCK_PRIMARY_PARAGRAPH , |
454 url, | 460 url, |
455 base::TimeFormatFriendlyDateAndTime(now))); | 461 base::TimeFormatFriendlyDateAndTime(now))); |
456 | 462 |
457 load_time_data.SetString( | 463 load_time_data.SetString( |
458 "primaryButtonText", | 464 "primaryButtonText", |
459 l10n_util::GetStringUTF16(IDS_SSL_V2_CLOCK_UPDATE_DATE_AND_TIME)); | 465 l10n_util::GetStringUTF16(IDS_SSL_V2_CLOCK_UPDATE_DATE_AND_TIME)); |
460 load_time_data.SetString( | 466 |
461 "openDetails", | 467 // We set the "Advanced" link to be empty so that it doesn't appear. |
462 l10n_util::GetStringUTF16(IDS_SSL_RELOAD)); | 468 load_time_data.SetString("openDetails", std::string()); |
463 | 469 |
464 // The interstitial template expects these strings, but we're not using | 470 // The interstitial template expects these strings, but we're not using |
465 // them. So we send blank strings for now. | 471 // them. So we send blank strings for now. |
466 load_time_data.SetString("explanationParagraph", std::string()); | 472 load_time_data.SetString("explanationParagraph", std::string()); |
467 load_time_data.SetString("finalParagraph", std::string()); | 473 load_time_data.SetString("finalParagraph", std::string()); |
468 } else { | 474 } else { |
469 load_time_data.SetBoolean("bad_clock", false); | 475 load_time_data.SetBoolean("bad_clock", false); |
470 | 476 |
471 load_time_data.SetString( | 477 load_time_data.SetString( |
472 "tabTitle", l10n_util::GetStringUTF16(IDS_SSL_V2_TITLE)); | 478 "tabTitle", l10n_util::GetStringUTF16(IDS_SSL_V2_TITLE)); |
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
699 for (; i < 5; i++) { | 705 for (; i < 5; i++) { |
700 strings->SetString(keys[i], std::string()); | 706 strings->SetString(keys[i], std::string()); |
701 } | 707 } |
702 } | 708 } |
703 | 709 |
704 void SSLBlockingPage::OnGotHistoryCount(bool success, | 710 void SSLBlockingPage::OnGotHistoryCount(bool success, |
705 int num_visits, | 711 int num_visits, |
706 base::Time first_visit) { | 712 base::Time first_visit) { |
707 num_visits_ = num_visits; | 713 num_visits_ = num_visits; |
708 } | 714 } |
OLD | NEW |