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 449 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
460 case CMD_DONT_PROCEED: { | 460 case CMD_DONT_PROCEED: { |
461 interstitial_page()->DontProceed(); | 461 interstitial_page()->DontProceed(); |
462 break; | 462 break; |
463 } | 463 } |
464 case CMD_PROCEED: { | 464 case CMD_PROCEED: { |
465 if (danger_overridable_) { | 465 if (danger_overridable_) { |
466 interstitial_page()->Proceed(); | 466 interstitial_page()->Proceed(); |
467 } | 467 } |
468 break; | 468 break; |
469 } | 469 } |
470 case CMD_MORE: { | 470 case CMD_SHOW_MORE_SECTION: { |
471 metrics_helper_->RecordUserInteraction( | 471 metrics_helper_->RecordUserInteraction( |
472 SecurityInterstitialMetricsHelper::SHOW_ADVANCED); | 472 SecurityInterstitialMetricsHelper::SHOW_ADVANCED); |
473 break; | 473 break; |
474 } | 474 } |
475 case CMD_RELOAD: { | 475 case CMD_OPEN_HELP_CENTER: { |
476 metrics_helper_->RecordUserInteraction( | |
477 SecurityInterstitialMetricsHelper::RELOAD); | |
478 // The interstitial can't refresh itself. | |
479 web_contents()->GetController().Reload(true); | |
480 break; | |
481 } | |
482 case CMD_HELP: { | |
483 metrics_helper_->RecordUserInteraction( | 476 metrics_helper_->RecordUserInteraction( |
484 SecurityInterstitialMetricsHelper::SHOW_LEARN_MORE); | 477 SecurityInterstitialMetricsHelper::SHOW_LEARN_MORE); |
485 content::NavigationController::LoadURLParams help_page_params( | 478 content::NavigationController::LoadURLParams help_page_params( |
486 google_util::AppendGoogleLocaleParam( | 479 google_util::AppendGoogleLocaleParam( |
487 GURL(kHelpURL), g_browser_process->GetApplicationLocale())); | 480 GURL(kHelpURL), g_browser_process->GetApplicationLocale())); |
488 web_contents()->GetController().LoadURLWithParams(help_page_params); | 481 web_contents()->GetController().LoadURLWithParams(help_page_params); |
489 break; | 482 break; |
490 } | 483 } |
491 case CMD_CLOCK: { | 484 case CMD_RELOAD: { |
485 metrics_helper_->RecordUserInteraction( | |
486 SecurityInterstitialMetricsHelper::RELOAD); | |
487 // The interstitial can't refresh itself. | |
488 web_contents()->GetController().Reload(true); | |
489 break; | |
490 } | |
491 case CMD_OPEN_DATE_SETTINGS: { | |
492 metrics_helper_->RecordUserInteraction( | 492 metrics_helper_->RecordUserInteraction( |
493 SecurityInterstitialMetricsHelper::OPEN_TIME_SETTINGS); | 493 SecurityInterstitialMetricsHelper::OPEN_TIME_SETTINGS); |
494 LaunchDateAndTimeSettings(); | 494 LaunchDateAndTimeSettings(); |
495 break; | 495 break; |
496 } | 496 } |
497 case CMD_OPEN_DIAGNOSTIC: | |
498 // Google doesn't currently have a transparency report for SSL. | |
499 case CMD_DO_REPORT: | |
500 case CMD_DONT_REPORT: | |
501 case CMD_OPEN_REPORTING_PRIVACY: | |
502 // Chrome doesn't currently do Extended Reporting for SSL. | |
503 break; | |
497 default: { | 504 default: { |
Bernhard Bauer
2015/03/11 08:42:14
Can we remove the default statement, so that the c
felt
2015/03/11 15:25:09
Done.
| |
498 NOTREACHED(); | 505 NOTREACHED(); |
499 } | 506 } |
500 } | 507 } |
501 } | 508 } |
502 | 509 |
503 void SSLBlockingPage::OverrideRendererPrefs( | 510 void SSLBlockingPage::OverrideRendererPrefs( |
504 content::RendererPreferences* prefs) { | 511 content::RendererPreferences* prefs) { |
505 Profile* profile = Profile::FromBrowserContext( | 512 Profile* profile = Profile::FromBrowserContext( |
506 web_contents()->GetBrowserContext()); | 513 web_contents()->GetBrowserContext()); |
507 renderer_preferences_util::UpdateFromSystemSettings( | 514 renderer_preferences_util::UpdateFromSystemSettings( |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
565 event_name.append(kEventNotOverridable); | 572 event_name.append(kEventNotOverridable); |
566 event_name.append(net::ErrorToString(cert_error_)); | 573 event_name.append(net::ErrorToString(cert_error_)); |
567 return event_name; | 574 return event_name; |
568 } | 575 } |
569 | 576 |
570 // static | 577 // static |
571 bool SSLBlockingPage::IsOptionsOverridable(int options_mask) { | 578 bool SSLBlockingPage::IsOptionsOverridable(int options_mask) { |
572 return (options_mask & SSLBlockingPage::OVERRIDABLE) && | 579 return (options_mask & SSLBlockingPage::OVERRIDABLE) && |
573 !(options_mask & SSLBlockingPage::STRICT_ENFORCEMENT); | 580 !(options_mask & SSLBlockingPage::STRICT_ENFORCEMENT); |
574 } | 581 } |
OLD | NEW |