Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3697)

Unified Diff: chrome/browser/ui/website_settings/website_settings_ui.cc

Issue 2262223002: Material Page Info (all desktop): Introduce new strings and styling info for the security section. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add cookie string. Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/website_settings/website_settings_ui.cc
diff --git a/chrome/browser/ui/website_settings/website_settings_ui.cc b/chrome/browser/ui/website_settings/website_settings_ui.cc
index d63d76369ba342aa0d4febf3102bf0f7502bef12..0f789b93094bf90c6944f71b75d7f19ce56909fb 100644
--- a/chrome/browser/ui/website_settings/website_settings_ui.cc
+++ b/chrome/browser/ui/website_settings/website_settings_ui.cc
@@ -18,6 +18,13 @@ namespace {
const int kInvalidResourceID = -1;
+// Dummy value.
+const SkColor COLOR_UNSTYLED = SkColorSetRGB(0x00, 0x00, 0x00);
+
+// Chrome Material colors for text on light background.
+const SkColor COLOR_MATERIAL_GREEN = SkColorSetRGB(0x0B, 0x80, 0x43);
+const SkColor COLOR_MATERIAL_RED = SkColorSetRGB(0xC5, 0x39, 0x29);
+
// The resource IDs for the strings that are displayed on the permissions
// button if the permission setting is managed by policy.
const int kPermissionButtonTextIDPolicyManaged[] = {
@@ -116,6 +123,19 @@ const PermissionsUIInfo kPermissionsUIInfo[] = {
IDR_ALLOWED_BACKGROUND_SYNC},
};
+std::unique_ptr<WebsiteSettingsUI::SecurityDescription>
+CreateSecurityDescription(int summary_id,
+ WebsiteSettingsUI::SecuritySummaryStyle summary_style,
+ SkColor summary_color,
+ int details_id) {
+ std::unique_ptr<WebsiteSettingsUI::SecurityDescription> security_description(
+ new WebsiteSettingsUI::SecurityDescription());
+ security_description->summary = l10n_util::GetStringUTF16(summary_id);
+ security_description->summary_style = summary_style;
+ security_description->summary_color = summary_color;
+ security_description->details = l10n_util::GetStringUTF16(details_id);
+ return security_description;
+}
} // namespace
WebsiteSettingsUI::CookieInfo::CookieInfo()
@@ -145,45 +165,56 @@ WebsiteSettingsUI::IdentityInfo::IdentityInfo()
WebsiteSettingsUI::IdentityInfo::~IdentityInfo() {}
-base::string16 WebsiteSettingsUI::IdentityInfo::GetSecuritySummary() const {
+std::unique_ptr<WebsiteSettingsUI::SecurityDescription>
+WebsiteSettingsUI::IdentityInfo::GetSecurityDescription() const {
+ std::unique_ptr<WebsiteSettingsUI::SecurityDescription> security_description(
+ new WebsiteSettingsUI::SecurityDescription());
+
switch (identity_status) {
+ case WebsiteSettings::SITE_IDENTITY_STATUS_INTERNAL_PAGE:
+ return CreateSecurityDescription(IDS_WEBSITE_SETTINGS_INTERNAL_PAGE,
+ STYLE_UNSTYLED, COLOR_UNSTYLED,
+ IDS_WEBSITE_SETTINGS_INTERNAL_PAGE);
case WebsiteSettings::SITE_IDENTITY_STATUS_CERT:
case WebsiteSettings::SITE_IDENTITY_STATUS_EV_CERT:
case WebsiteSettings::SITE_IDENTITY_STATUS_CERT_REVOCATION_UNKNOWN:
+ case WebsiteSettings::SITE_IDENTITY_STATUS_CT_ERROR:
+ case WebsiteSettings::SITE_IDENTITY_STATUS_ADMIN_PROVIDED_CERT:
switch (connection_status) {
case WebsiteSettings::
- SITE_CONNECTION_STATUS_INSECURE_PASSIVE_SUBRESOURCE:
- return l10n_util::GetStringUTF16(
- IDS_WEBSITE_SETTINGS_INSECURE_PASSIVE_CONTENT);
- case WebsiteSettings::
SITE_CONNECTION_STATUS_INSECURE_ACTIVE_SUBRESOURCE:
- return l10n_util::GetStringUTF16(
- IDS_WEBSITE_SETTINGS_INSECURE_ACTIVE_CONTENT);
+ return CreateSecurityDescription(
+ IDS_WEBSITE_SETTINGS_NOT_SECURE_SUMMARY, STYLE_COLOR,
+ COLOR_MATERIAL_RED, IDS_WEBSITE_SETTINGS_NOT_SECURE_DETAILS);
+ case WebsiteSettings::
+ SITE_CONNECTION_STATUS_INSECURE_PASSIVE_SUBRESOURCE:
+ return CreateSecurityDescription(
+ IDS_WEBSITE_SETTINGS_MIXED_CONTENT_SUMMARY, STYLE_COLOR,
+ COLOR_MATERIAL_RED, IDS_WEBSITE_SETTINGS_MIXED_CONTENT_DETAILS);
default:
- return l10n_util::GetStringUTF16(
- IDS_WEBSITE_SETTINGS_SECURE_TRANSPORT);
+ return CreateSecurityDescription(IDS_WEBSITE_SETTINGS_SECURE_SUMMARY,
+ STYLE_COLOR, COLOR_MATERIAL_GREEN,
+ IDS_WEBSITE_SETTINGS_SECURE_DETAILS);
}
case WebsiteSettings::
SITE_IDENTITY_STATUS_DEPRECATED_SIGNATURE_ALGORITHM_MINOR:
case WebsiteSettings::
SITE_IDENTITY_STATUS_DEPRECATED_SIGNATURE_ALGORITHM_MAJOR:
- return l10n_util::GetStringUTF16(
- IDS_WEBSITE_DEPRECATED_SIGNATURE_ALGORITHM);
- case WebsiteSettings::SITE_IDENTITY_STATUS_ADMIN_PROVIDED_CERT:
- return l10n_util::GetStringUTF16(IDS_CERT_POLICY_PROVIDED_CERT_HEADER);
case WebsiteSettings::SITE_IDENTITY_STATUS_UNKNOWN:
- return l10n_util::GetStringUTF16(IDS_WEBSITE_SETTINGS_UNKNOWN_TRANSPORT);
- case WebsiteSettings::SITE_IDENTITY_STATUS_CT_ERROR:
- return l10n_util::GetStringUTF16(IDS_WEBSITE_SETTINGS_CT_ERROR);
- case WebsiteSettings::SITE_IDENTITY_STATUS_INTERNAL_PAGE:
- return l10n_util::GetStringUTF16(IDS_WEBSITE_SETTINGS_INTERNAL_PAGE);
case WebsiteSettings::SITE_IDENTITY_STATUS_NO_CERT:
default:
- return l10n_util::GetStringUTF16(
- IDS_WEBSITE_SETTINGS_NON_SECURE_TRANSPORT);
+ return CreateSecurityDescription(IDS_WEBSITE_SETTINGS_NOT_SECURE_SUMMARY,
+ STYLE_COLOR, COLOR_MATERIAL_RED,
+ IDS_WEBSITE_SETTINGS_NOT_SECURE_DETAILS);
}
}
+base::string16 WebsiteSettingsUI::IdentityInfo::GetSecuritySummary() const {
+ std::unique_ptr<WebsiteSettingsUI::SecurityDescription> security_description =
+ GetSecurityDescription();
+ return security_description->summary;
+}
+
WebsiteSettingsUI::~WebsiteSettingsUI() {
}

Powered by Google App Engine
This is Rietveld 408576698