| 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/ui/website_settings/website_settings.h" | 5 #include "chrome/browser/ui/website_settings/website_settings.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 321 did_revoke_user_ssl_decisions_ ? USER_CERT_DECISIONS_REVOKED | 321 did_revoke_user_ssl_decisions_ ? USER_CERT_DECISIONS_REVOKED |
| 322 : USER_CERT_DECISIONS_NOT_REVOKED; | 322 : USER_CERT_DECISIONS_NOT_REVOKED; |
| 323 | 323 |
| 324 UMA_HISTOGRAM_ENUMERATION("interstitial.ssl.did_user_revoke_decisions", | 324 UMA_HISTOGRAM_ENUMERATION("interstitial.ssl.did_user_revoke_decisions", |
| 325 user_decision, | 325 user_decision, |
| 326 END_OF_SSL_CERTIFICATE_DECISIONS_DID_REVOKE_ENUM); | 326 END_OF_SSL_CERTIFICATE_DECISIONS_DID_REVOKE_ENUM); |
| 327 } | 327 } |
| 328 | 328 |
| 329 void WebsiteSettings::OnRevokeSSLErrorBypassButtonPressed() { | 329 void WebsiteSettings::OnRevokeSSLErrorBypassButtonPressed() { |
| 330 DCHECK(chrome_ssl_host_state_delegate_); | 330 DCHECK(chrome_ssl_host_state_delegate_); |
| 331 chrome_ssl_host_state_delegate_->RevokeUserDecisionsHard(site_url().host()); | 331 chrome_ssl_host_state_delegate_->RevokeUserAllowExceptionsHard( |
| 332 site_url().host()); |
| 332 did_revoke_user_ssl_decisions_ = true; | 333 did_revoke_user_ssl_decisions_ = true; |
| 333 } | 334 } |
| 334 | 335 |
| 335 void WebsiteSettings::Init(Profile* profile, | 336 void WebsiteSettings::Init(Profile* profile, |
| 336 const GURL& url, | 337 const GURL& url, |
| 337 const content::SSLStatus& ssl) { | 338 const content::SSLStatus& ssl) { |
| 338 if (url.SchemeIs(content::kChromeUIScheme)) { | 339 if (url.SchemeIs(content::kChromeUIScheme)) { |
| 339 site_identity_status_ = SITE_IDENTITY_STATUS_INTERNAL_PAGE; | 340 site_identity_status_ = SITE_IDENTITY_STATUS_INTERNAL_PAGE; |
| 340 site_identity_details_ = | 341 site_identity_details_ = |
| 341 l10n_util::GetStringUTF16(IDS_PAGE_INFO_INTERNAL_PAGE); | 342 l10n_util::GetStringUTF16(IDS_PAGE_INFO_INTERNAL_PAGE); |
| (...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 575 } | 576 } |
| 576 | 577 |
| 577 // Check if a user decision has been made to allow or deny certificates with | 578 // Check if a user decision has been made to allow or deny certificates with |
| 578 // errors on this site. | 579 // errors on this site. |
| 579 ChromeSSLHostStateDelegate* delegate = | 580 ChromeSSLHostStateDelegate* delegate = |
| 580 ChromeSSLHostStateDelegateFactory::GetForProfile(profile); | 581 ChromeSSLHostStateDelegateFactory::GetForProfile(profile); |
| 581 DCHECK(delegate); | 582 DCHECK(delegate); |
| 582 // Only show an SSL decision revoke button if both the user has chosen to | 583 // Only show an SSL decision revoke button if both the user has chosen to |
| 583 // bypass SSL host errors for this host in the past and the user is not using | 584 // bypass SSL host errors for this host in the past and the user is not using |
| 584 // the traditional "forget-at-session-restart" error decision memory. | 585 // the traditional "forget-at-session-restart" error decision memory. |
| 585 show_ssl_decision_revoke_button_ = delegate->HasUserDecision(url.host()) && | 586 show_ssl_decision_revoke_button_ = delegate->HasAllowed(url.host()) && |
| 586 InRememberCertificateErrorDecisionsGroup(); | 587 InRememberCertificateErrorDecisionsGroup(); |
| 587 | 588 |
| 588 // By default select the permissions tab that displays all the site | 589 // By default select the permissions tab that displays all the site |
| 589 // permissions. In case of a connection error or an issue with the | 590 // permissions. In case of a connection error or an issue with the |
| 590 // certificate presented by the website, select the connection tab to draw | 591 // certificate presented by the website, select the connection tab to draw |
| 591 // the user's attention to the issue. If the site does not provide a | 592 // the user's attention to the issue. If the site does not provide a |
| 592 // certificate because it was loaded over an unencrypted connection, don't | 593 // certificate because it was loaded over an unencrypted connection, don't |
| 593 // select the connection tab. | 594 // select the connection tab. |
| 594 WebsiteSettingsUI::TabId tab_id = WebsiteSettingsUI::TAB_ID_PERMISSIONS; | 595 WebsiteSettingsUI::TabId tab_id = WebsiteSettingsUI::TAB_ID_PERMISSIONS; |
| 595 if (site_connection_status_ == SITE_CONNECTION_STATUS_ENCRYPTED_ERROR || | 596 if (site_connection_status_ == SITE_CONNECTION_STATUS_ENCRYPTED_ERROR || |
| 596 site_connection_status_ == SITE_CONNECTION_STATUS_MIXED_CONTENT || | 597 site_connection_status_ == SITE_CONNECTION_STATUS_MIXED_CONTENT || |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 737 if (visited_before_today) { | 738 if (visited_before_today) { |
| 738 first_visit_text = l10n_util::GetStringFUTF16( | 739 first_visit_text = l10n_util::GetStringFUTF16( |
| 739 IDS_PAGE_INFO_SECURITY_TAB_VISITED_BEFORE_TODAY, | 740 IDS_PAGE_INFO_SECURITY_TAB_VISITED_BEFORE_TODAY, |
| 740 base::TimeFormatShortDate(first_visit)); | 741 base::TimeFormatShortDate(first_visit)); |
| 741 } else { | 742 } else { |
| 742 first_visit_text = l10n_util::GetStringUTF16( | 743 first_visit_text = l10n_util::GetStringUTF16( |
| 743 IDS_PAGE_INFO_SECURITY_TAB_FIRST_VISITED_TODAY); | 744 IDS_PAGE_INFO_SECURITY_TAB_FIRST_VISITED_TODAY); |
| 744 } | 745 } |
| 745 ui_->SetFirstVisit(first_visit_text); | 746 ui_->SetFirstVisit(first_visit_text); |
| 746 } | 747 } |
| OLD | NEW |