| 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 712 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 723 | 723 |
| 724 void WebsiteSettings::PresentSiteData() { | 724 void WebsiteSettings::PresentSiteData() { |
| 725 CookieInfoList cookie_info_list; | 725 CookieInfoList cookie_info_list; |
| 726 const LocalSharedObjectsCounter& allowed_objects = | 726 const LocalSharedObjectsCounter& allowed_objects = |
| 727 tab_specific_content_settings()->allowed_local_shared_objects(); | 727 tab_specific_content_settings()->allowed_local_shared_objects(); |
| 728 const LocalSharedObjectsCounter& blocked_objects = | 728 const LocalSharedObjectsCounter& blocked_objects = |
| 729 tab_specific_content_settings()->blocked_local_shared_objects(); | 729 tab_specific_content_settings()->blocked_local_shared_objects(); |
| 730 | 730 |
| 731 // Add first party cookie and site data counts. | 731 // Add first party cookie and site data counts. |
| 732 WebsiteSettingsUI::CookieInfo cookie_info; | 732 WebsiteSettingsUI::CookieInfo cookie_info; |
| 733 cookie_info.cookie_source = | |
| 734 l10n_util::GetStringUTF8(IDS_WEBSITE_SETTINGS_FIRST_PARTY_SITE_DATA); | |
| 735 cookie_info.allowed = allowed_objects.GetObjectCountForDomain(site_url_); | 733 cookie_info.allowed = allowed_objects.GetObjectCountForDomain(site_url_); |
| 736 cookie_info.blocked = blocked_objects.GetObjectCountForDomain(site_url_); | 734 cookie_info.blocked = blocked_objects.GetObjectCountForDomain(site_url_); |
| 737 cookie_info.is_first_party = true; | 735 cookie_info.is_first_party = true; |
| 738 cookie_info_list.push_back(cookie_info); | 736 cookie_info_list.push_back(cookie_info); |
| 739 | 737 |
| 740 // Add third party cookie counts. | 738 // Add third party cookie counts. |
| 741 cookie_info.cookie_source = l10n_util::GetStringUTF8( | |
| 742 IDS_WEBSITE_SETTINGS_THIRD_PARTY_SITE_DATA); | |
| 743 cookie_info.allowed = allowed_objects.GetObjectCount() - cookie_info.allowed; | 739 cookie_info.allowed = allowed_objects.GetObjectCount() - cookie_info.allowed; |
| 744 cookie_info.blocked = blocked_objects.GetObjectCount() - cookie_info.blocked; | 740 cookie_info.blocked = blocked_objects.GetObjectCount() - cookie_info.blocked; |
| 745 cookie_info.is_first_party = false; | 741 cookie_info.is_first_party = false; |
| 746 cookie_info_list.push_back(cookie_info); | 742 cookie_info_list.push_back(cookie_info); |
| 747 | 743 |
| 748 ui_->SetCookieInfo(cookie_info_list); | 744 ui_->SetCookieInfo(cookie_info_list); |
| 749 } | 745 } |
| 750 | 746 |
| 751 void WebsiteSettings::PresentSiteIdentity() { | 747 void WebsiteSettings::PresentSiteIdentity() { |
| 752 // After initialization the status about the site's connection and its | 748 // After initialization the status about the site's connection and its |
| 753 // identity must be available. | 749 // identity must be available. |
| 754 DCHECK_NE(site_identity_status_, SITE_IDENTITY_STATUS_UNKNOWN); | 750 DCHECK_NE(site_identity_status_, SITE_IDENTITY_STATUS_UNKNOWN); |
| 755 DCHECK_NE(site_connection_status_, SITE_CONNECTION_STATUS_UNKNOWN); | 751 DCHECK_NE(site_connection_status_, SITE_CONNECTION_STATUS_UNKNOWN); |
| 756 WebsiteSettingsUI::IdentityInfo info; | 752 WebsiteSettingsUI::IdentityInfo info; |
| 757 if (site_identity_status_ == SITE_IDENTITY_STATUS_EV_CERT) | 753 if (site_identity_status_ == SITE_IDENTITY_STATUS_EV_CERT) |
| 758 info.site_identity = UTF16ToUTF8(organization_name()); | 754 info.site_identity = UTF16ToUTF8(organization_name()); |
| 759 else | 755 else |
| 760 info.site_identity = UTF16ToUTF8(GetSimpleSiteName(site_url_)); | 756 info.site_identity = UTF16ToUTF8(GetSimpleSiteName(site_url_)); |
| 761 | 757 |
| 762 info.connection_status = site_connection_status_; | 758 info.connection_status = site_connection_status_; |
| 763 info.connection_status_description = | 759 info.connection_status_description = |
| 764 UTF16ToUTF8(site_connection_details_); | 760 UTF16ToUTF8(site_connection_details_); |
| 765 info.identity_status = site_identity_status_; | 761 info.identity_status = site_identity_status_; |
| 766 info.identity_status_description = | 762 info.identity_status_description = |
| 767 UTF16ToUTF8(site_identity_details_); | 763 UTF16ToUTF8(site_identity_details_); |
| 768 info.cert_id = cert_id_; | 764 info.cert_id = cert_id_; |
| 769 info.show_ssl_decision_revoke_button = show_ssl_decision_revoke_button_; | 765 info.show_ssl_decision_revoke_button = show_ssl_decision_revoke_button_; |
| 770 ui_->SetIdentityInfo(info); | 766 ui_->SetIdentityInfo(info); |
| 771 } | 767 } |
| OLD | NEW |