| 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_ui.h" | 5 #include "chrome/browser/ui/website_settings/website_settings_ui.h" |
| 6 | 6 |
| 7 #include "grit/generated_resources.h" | 7 #include "grit/generated_resources.h" |
| 8 #include "grit/theme_resources.h" | 8 #include "grit/theme_resources.h" |
| 9 #include "grit/ui_resources.h" | 9 #include "grit/ui_resources.h" |
| 10 #include "ui/base/l10n/l10n_util.h" | 10 #include "ui/base/l10n/l10n_util.h" |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 : identity_status(WebsiteSettings::SITE_IDENTITY_STATUS_UNKNOWN), | 84 : identity_status(WebsiteSettings::SITE_IDENTITY_STATUS_UNKNOWN), |
| 85 cert_id(0), | 85 cert_id(0), |
| 86 connection_status(WebsiteSettings::SITE_CONNECTION_STATUS_UNKNOWN) { | 86 connection_status(WebsiteSettings::SITE_CONNECTION_STATUS_UNKNOWN) { |
| 87 } | 87 } |
| 88 | 88 |
| 89 string16 WebsiteSettingsUI::IdentityInfo::GetIdentityStatusText() const { | 89 string16 WebsiteSettingsUI::IdentityInfo::GetIdentityStatusText() const { |
| 90 if (identity_status == WebsiteSettings::SITE_IDENTITY_STATUS_CERT || | 90 if (identity_status == WebsiteSettings::SITE_IDENTITY_STATUS_CERT || |
| 91 identity_status == WebsiteSettings::SITE_IDENTITY_STATUS_EV_CERT) { | 91 identity_status == WebsiteSettings::SITE_IDENTITY_STATUS_EV_CERT) { |
| 92 return l10n_util::GetStringUTF16(IDS_WEBSITE_SETTINGS_IDENTITY_VERIFIED); | 92 return l10n_util::GetStringUTF16(IDS_WEBSITE_SETTINGS_IDENTITY_VERIFIED); |
| 93 } | 93 } |
| 94 if (identity_status == |
| 95 WebsiteSettings::SITE_IDENTITY_STATUS_ADMIN_PROVIDED_CERT) { |
| 96 return l10n_util::GetStringUTF16(IDS_CERT_POLICY_PROVIDED_CERT_HEADER); |
| 97 } |
| 94 return l10n_util::GetStringUTF16(IDS_WEBSITE_SETTINGS_IDENTITY_NOT_VERIFIED); | 98 return l10n_util::GetStringUTF16(IDS_WEBSITE_SETTINGS_IDENTITY_NOT_VERIFIED); |
| 95 } | 99 } |
| 96 | 100 |
| 97 WebsiteSettingsUI::~WebsiteSettingsUI() { | 101 WebsiteSettingsUI::~WebsiteSettingsUI() { |
| 98 } | 102 } |
| 99 | 103 |
| 100 // static | 104 // static |
| 101 string16 WebsiteSettingsUI::PermissionTypeToUIString( | 105 string16 WebsiteSettingsUI::PermissionTypeToUIString( |
| 102 ContentSettingsType type) { | 106 ContentSettingsType type) { |
| 103 switch (type) { | 107 switch (type) { |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 242 break; | 246 break; |
| 243 case WebsiteSettings::SITE_IDENTITY_STATUS_CERT_REVOCATION_UNKNOWN: | 247 case WebsiteSettings::SITE_IDENTITY_STATUS_CERT_REVOCATION_UNKNOWN: |
| 244 resource_id = IDR_PAGEINFO_WARNING_MINOR; | 248 resource_id = IDR_PAGEINFO_WARNING_MINOR; |
| 245 break; | 249 break; |
| 246 case WebsiteSettings::SITE_IDENTITY_STATUS_NO_CERT: | 250 case WebsiteSettings::SITE_IDENTITY_STATUS_NO_CERT: |
| 247 resource_id = IDR_PAGEINFO_WARNING_MAJOR; | 251 resource_id = IDR_PAGEINFO_WARNING_MAJOR; |
| 248 break; | 252 break; |
| 249 case WebsiteSettings::SITE_IDENTITY_STATUS_ERROR: | 253 case WebsiteSettings::SITE_IDENTITY_STATUS_ERROR: |
| 250 resource_id = IDR_PAGEINFO_BAD; | 254 resource_id = IDR_PAGEINFO_BAD; |
| 251 break; | 255 break; |
| 256 case WebsiteSettings::SITE_IDENTITY_STATUS_ADMIN_PROVIDED_CERT: |
| 257 resource_id = IDR_CONTROLLED_SETTING_MANDATORY_LARGE; |
| 258 break; |
| 252 default: | 259 default: |
| 253 NOTREACHED(); | 260 NOTREACHED(); |
| 254 break; | 261 break; |
| 255 } | 262 } |
| 256 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); | 263 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); |
| 257 return rb.GetNativeImageNamed(resource_id); | 264 return rb.GetNativeImageNamed(resource_id); |
| 258 } | 265 } |
| 259 | 266 |
| 260 // static | 267 // static |
| 261 const gfx::Image& WebsiteSettingsUI::GetConnectionIcon( | 268 const gfx::Image& WebsiteSettingsUI::GetConnectionIcon( |
| (...skipping 23 matching lines...) Expand all Loading... |
| 285 } | 292 } |
| 286 | 293 |
| 287 // static | 294 // static |
| 288 const gfx::Image& WebsiteSettingsUI::GetFirstVisitIcon( | 295 const gfx::Image& WebsiteSettingsUI::GetFirstVisitIcon( |
| 289 const string16& first_visit) { | 296 const string16& first_visit) { |
| 290 // FIXME(markusheintz): Display a minor warning icon if the page is visited | 297 // FIXME(markusheintz): Display a minor warning icon if the page is visited |
| 291 // the first time. | 298 // the first time. |
| 292 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); | 299 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); |
| 293 return rb.GetNativeImageNamed(IDR_PAGEINFO_INFO); | 300 return rb.GetNativeImageNamed(IDR_PAGEINFO_INFO); |
| 294 } | 301 } |
| OLD | NEW |