| 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/page_info/page_info_ui.h" | 5 #include "chrome/browser/ui/page_info/page_info_ui.h" |
| 6 | 6 |
| 7 #include "base/macros.h" | 7 #include "base/macros.h" |
| 8 #include "chrome/browser/content_settings/host_content_settings_map_factory.h" | 8 #include "chrome/browser/content_settings/host_content_settings_map_factory.h" |
| 9 #include "chrome/browser/permissions/permission_manager.h" | 9 #include "chrome/browser/permissions/permission_manager.h" |
| 10 #include "chrome/browser/permissions/permission_result.h" | 10 #include "chrome/browser/permissions/permission_result.h" |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 199 #endif | 199 #endif |
| 200 // Internal pages on desktop have their own UI implementations which | 200 // Internal pages on desktop have their own UI implementations which |
| 201 // should never call this function. | 201 // should never call this function. |
| 202 NOTREACHED(); | 202 NOTREACHED(); |
| 203 case PageInfo::SITE_IDENTITY_STATUS_CERT: | 203 case PageInfo::SITE_IDENTITY_STATUS_CERT: |
| 204 case PageInfo::SITE_IDENTITY_STATUS_EV_CERT: | 204 case PageInfo::SITE_IDENTITY_STATUS_EV_CERT: |
| 205 case PageInfo::SITE_IDENTITY_STATUS_CERT_REVOCATION_UNKNOWN: | 205 case PageInfo::SITE_IDENTITY_STATUS_CERT_REVOCATION_UNKNOWN: |
| 206 case PageInfo::SITE_IDENTITY_STATUS_ADMIN_PROVIDED_CERT: | 206 case PageInfo::SITE_IDENTITY_STATUS_ADMIN_PROVIDED_CERT: |
| 207 switch (connection_status) { | 207 switch (connection_status) { |
| 208 case PageInfo::SITE_CONNECTION_STATUS_INSECURE_ACTIVE_SUBRESOURCE: | 208 case PageInfo::SITE_CONNECTION_STATUS_INSECURE_ACTIVE_SUBRESOURCE: |
| 209 return CreateSecurityDescription(IDS_PAGEINFO_NOT_SECURE_SUMMARY, | 209 return CreateSecurityDescription(IDS_PAGE_INFO_NOT_SECURE_SUMMARY, |
| 210 IDS_PAGEINFO_NOT_SECURE_DETAILS); | 210 IDS_PAGE_INFO_NOT_SECURE_DETAILS); |
| 211 case PageInfo::SITE_CONNECTION_STATUS_INSECURE_FORM_ACTION: | 211 case PageInfo::SITE_CONNECTION_STATUS_INSECURE_FORM_ACTION: |
| 212 return CreateSecurityDescription(IDS_PAGEINFO_MIXED_CONTENT_SUMMARY, | 212 return CreateSecurityDescription(IDS_PAGE_INFO_MIXED_CONTENT_SUMMARY, |
| 213 IDS_PAGEINFO_NOT_SECURE_DETAILS); | 213 IDS_PAGE_INFO_NOT_SECURE_DETAILS); |
| 214 case PageInfo::SITE_CONNECTION_STATUS_INSECURE_PASSIVE_SUBRESOURCE: | 214 case PageInfo::SITE_CONNECTION_STATUS_INSECURE_PASSIVE_SUBRESOURCE: |
| 215 return CreateSecurityDescription(IDS_PAGEINFO_MIXED_CONTENT_SUMMARY, | 215 return CreateSecurityDescription(IDS_PAGE_INFO_MIXED_CONTENT_SUMMARY, |
| 216 IDS_PAGEINFO_MIXED_CONTENT_DETAILS); | 216 IDS_PAGE_INFO_MIXED_CONTENT_DETAILS); |
| 217 default: | 217 default: |
| 218 return CreateSecurityDescription(IDS_PAGEINFO_SECURE_SUMMARY, | 218 return CreateSecurityDescription(IDS_PAGE_INFO_SECURE_SUMMARY, |
| 219 IDS_PAGEINFO_SECURE_DETAILS); | 219 IDS_PAGE_INFO_SECURE_DETAILS); |
| 220 } | 220 } |
| 221 case PageInfo::SITE_IDENTITY_STATUS_MALWARE: | 221 case PageInfo::SITE_IDENTITY_STATUS_MALWARE: |
| 222 return CreateSecurityDescription(IDS_PAGEINFO_MALWARE_SUMMARY, | 222 return CreateSecurityDescription(IDS_PAGE_INFO_MALWARE_SUMMARY, |
| 223 IDS_PAGEINFO_MALWARE_DETAILS); | 223 IDS_PAGE_INFO_MALWARE_DETAILS); |
| 224 case PageInfo::SITE_IDENTITY_STATUS_SOCIAL_ENGINEERING: | 224 case PageInfo::SITE_IDENTITY_STATUS_SOCIAL_ENGINEERING: |
| 225 return CreateSecurityDescription(IDS_PAGEINFO_SOCIAL_ENGINEERING_SUMMARY, | 225 return CreateSecurityDescription( |
| 226 IDS_PAGEINFO_SOCIAL_ENGINEERING_DETAILS); | 226 IDS_PAGE_INFO_SOCIAL_ENGINEERING_SUMMARY, |
| 227 IDS_PAGE_INFO_SOCIAL_ENGINEERING_DETAILS); |
| 227 case PageInfo::SITE_IDENTITY_STATUS_UNWANTED_SOFTWARE: | 228 case PageInfo::SITE_IDENTITY_STATUS_UNWANTED_SOFTWARE: |
| 228 return CreateSecurityDescription(IDS_PAGEINFO_UNWANTED_SOFTWARE_SUMMARY, | 229 return CreateSecurityDescription(IDS_PAGE_INFO_UNWANTED_SOFTWARE_SUMMARY, |
| 229 IDS_PAGEINFO_UNWANTED_SOFTWARE_DETAILS); | 230 IDS_PAGE_INFO_UNWANTED_SOFTWARE_DETAILS); |
| 230 case PageInfo::SITE_IDENTITY_STATUS_DEPRECATED_SIGNATURE_ALGORITHM: | 231 case PageInfo::SITE_IDENTITY_STATUS_DEPRECATED_SIGNATURE_ALGORITHM: |
| 231 case PageInfo::SITE_IDENTITY_STATUS_UNKNOWN: | 232 case PageInfo::SITE_IDENTITY_STATUS_UNKNOWN: |
| 232 case PageInfo::SITE_IDENTITY_STATUS_NO_CERT: | 233 case PageInfo::SITE_IDENTITY_STATUS_NO_CERT: |
| 233 default: | 234 default: |
| 234 return CreateSecurityDescription(IDS_PAGEINFO_NOT_SECURE_SUMMARY, | 235 return CreateSecurityDescription(IDS_PAGE_INFO_NOT_SECURE_SUMMARY, |
| 235 IDS_PAGEINFO_NOT_SECURE_DETAILS); | 236 IDS_PAGE_INFO_NOT_SECURE_DETAILS); |
| 236 } | 237 } |
| 237 } | 238 } |
| 238 | 239 |
| 239 PageInfoUI::~PageInfoUI() {} | 240 PageInfoUI::~PageInfoUI() {} |
| 240 | 241 |
| 241 // static | 242 // static |
| 242 base::string16 PageInfoUI::PermissionTypeToUIString(ContentSettingsType type) { | 243 base::string16 PageInfoUI::PermissionTypeToUIString(ContentSettingsType type) { |
| 243 for (const PermissionsUIInfo& info : kPermissionsUIInfo) { | 244 for (const PermissionsUIInfo& info : kPermissionsUIInfo) { |
| 244 if (info.type == type) | 245 if (info.type == type) |
| 245 return l10n_util::GetStringUTF16(info.string_id); | 246 return l10n_util::GetStringUTF16(info.string_id); |
| (...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 441 } | 442 } |
| 442 return resource_id; | 443 return resource_id; |
| 443 } | 444 } |
| 444 | 445 |
| 445 // static | 446 // static |
| 446 const gfx::Image& PageInfoUI::GetConnectionIcon( | 447 const gfx::Image& PageInfoUI::GetConnectionIcon( |
| 447 PageInfo::SiteConnectionStatus status) { | 448 PageInfo::SiteConnectionStatus status) { |
| 448 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); | 449 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); |
| 449 return rb.GetNativeImageNamed(GetConnectionIconID(status)); | 450 return rb.GetNativeImageNamed(GetConnectionIconID(status)); |
| 450 } | 451 } |
| OLD | NEW |