| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <string> | 10 #include <string> |
| (...skipping 649 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 660 } | 660 } |
| 661 | 661 |
| 662 // Check if a user decision has been made to allow or deny certificates with | 662 // Check if a user decision has been made to allow or deny certificates with |
| 663 // errors on this site. | 663 // errors on this site. |
| 664 ChromeSSLHostStateDelegate* delegate = | 664 ChromeSSLHostStateDelegate* delegate = |
| 665 ChromeSSLHostStateDelegateFactory::GetForProfile(profile_); | 665 ChromeSSLHostStateDelegateFactory::GetForProfile(profile_); |
| 666 DCHECK(delegate); | 666 DCHECK(delegate); |
| 667 // Only show an SSL decision revoke button if the user has chosen to bypass | 667 // Only show an SSL decision revoke button if the user has chosen to bypass |
| 668 // SSL host errors for this host in the past. | 668 // SSL host errors for this host in the past. |
| 669 show_ssl_decision_revoke_button_ = delegate->HasAllowException(url.host()); | 669 show_ssl_decision_revoke_button_ = delegate->HasAllowException(url.host()); |
| 670 | |
| 671 // By default select the Permissions Tab that displays all the site | |
| 672 // permissions. In case of a connection error or an issue with the certificate | |
| 673 // presented by the website, select the Connection Tab to draw the user's | |
| 674 // attention to the issue. If the site does not provide a certificate because | |
| 675 // it was loaded over an unencrypted connection, don't select the Connection | |
| 676 // Tab. | |
| 677 WebsiteSettingsUI::TabId tab_id = WebsiteSettingsUI::TAB_ID_PERMISSIONS; | |
| 678 if (site_connection_status_ == SITE_CONNECTION_STATUS_ENCRYPTED_ERROR || | |
| 679 site_connection_status_ == | |
| 680 SITE_CONNECTION_STATUS_INSECURE_PASSIVE_SUBRESOURCE || | |
| 681 site_connection_status_ == | |
| 682 SITE_CONNECTION_STATUS_INSECURE_ACTIVE_SUBRESOURCE || | |
| 683 site_identity_status_ == SITE_IDENTITY_STATUS_ERROR || | |
| 684 site_identity_status_ == SITE_IDENTITY_STATUS_CERT_REVOCATION_UNKNOWN || | |
| 685 site_identity_status_ == SITE_IDENTITY_STATUS_ADMIN_PROVIDED_CERT || | |
| 686 site_identity_status_ == | |
| 687 SITE_IDENTITY_STATUS_DEPRECATED_SIGNATURE_ALGORITHM_MINOR || | |
| 688 site_identity_status_ == | |
| 689 SITE_IDENTITY_STATUS_DEPRECATED_SIGNATURE_ALGORITHM_MAJOR) { | |
| 690 tab_id = WebsiteSettingsUI::TAB_ID_CONNECTION; | |
| 691 RecordWebsiteSettingsAction( | |
| 692 WEBSITE_SETTINGS_CONNECTION_TAB_SHOWN_IMMEDIATELY); | |
| 693 } | |
| 694 | |
| 695 ui_->SetSelectedTab(tab_id); | |
| 696 } | 670 } |
| 697 | 671 |
| 698 void WebsiteSettings::PresentSitePermissions() { | 672 void WebsiteSettings::PresentSitePermissions() { |
| 699 PermissionInfoList permission_info_list; | 673 PermissionInfoList permission_info_list; |
| 700 ChosenObjectInfoList chosen_object_info_list; | 674 ChosenObjectInfoList chosen_object_info_list; |
| 701 | 675 |
| 702 WebsiteSettingsUI::PermissionInfo permission_info; | 676 WebsiteSettingsUI::PermissionInfo permission_info; |
| 703 for (size_t i = 0; i < arraysize(kPermissionType); ++i) { | 677 for (size_t i = 0; i < arraysize(kPermissionType); ++i) { |
| 704 permission_info.type = kPermissionType[i]; | 678 permission_info.type = kPermissionType[i]; |
| 705 | 679 |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 792 info.connection_status = site_connection_status_; | 766 info.connection_status = site_connection_status_; |
| 793 info.connection_status_description = | 767 info.connection_status_description = |
| 794 UTF16ToUTF8(site_connection_details_); | 768 UTF16ToUTF8(site_connection_details_); |
| 795 info.identity_status = site_identity_status_; | 769 info.identity_status = site_identity_status_; |
| 796 info.identity_status_description = | 770 info.identity_status_description = |
| 797 UTF16ToUTF8(site_identity_details_); | 771 UTF16ToUTF8(site_identity_details_); |
| 798 info.certificate = certificate_; | 772 info.certificate = certificate_; |
| 799 info.show_ssl_decision_revoke_button = show_ssl_decision_revoke_button_; | 773 info.show_ssl_decision_revoke_button = show_ssl_decision_revoke_button_; |
| 800 ui_->SetIdentityInfo(info); | 774 ui_->SetIdentityInfo(info); |
| 801 } | 775 } |
| OLD | NEW |