Index: chrome/browser/ui/page_info/page_info_ui.cc |
diff --git a/chrome/browser/ui/page_info/website_settings_ui.cc b/chrome/browser/ui/page_info/page_info_ui.cc |
similarity index 74% |
rename from chrome/browser/ui/page_info/website_settings_ui.cc |
rename to chrome/browser/ui/page_info/page_info_ui.cc |
index f65f3fb6c0c04ceea03c1e8c4919a0ef9d2c2705..c794d7981be10d86b296a8f63b279e066b8fe820 100644 |
--- a/chrome/browser/ui/page_info/website_settings_ui.cc |
+++ b/chrome/browser/ui/page_info/page_info_ui.cc |
@@ -2,7 +2,7 @@ |
// Use of this source code is governed by a BSD-style license that can be |
// found in the LICENSE file. |
-#include "chrome/browser/ui/page_info/website_settings_ui.h" |
+#include "chrome/browser/ui/page_info/page_info_ui.h" |
#include "base/macros.h" |
#include "chrome/browser/content_settings/host_content_settings_map_factory.h" |
@@ -117,89 +117,87 @@ const PermissionsUIInfo kPermissionsUIInfo[] = { |
{CONTENT_SETTINGS_TYPE_AUTOPLAY, IDS_WEBSITE_SETTINGS_TYPE_AUTOPLAY, 0, 0}, |
}; |
-std::unique_ptr<WebsiteSettingsUI::SecurityDescription> |
-CreateSecurityDescription(int summary_id, int details_id) { |
- std::unique_ptr<WebsiteSettingsUI::SecurityDescription> security_description( |
- new WebsiteSettingsUI::SecurityDescription()); |
+std::unique_ptr<PageInfoUI::SecurityDescription> CreateSecurityDescription( |
+ int summary_id, |
+ int details_id) { |
+ std::unique_ptr<PageInfoUI::SecurityDescription> security_description( |
+ new PageInfoUI::SecurityDescription()); |
security_description->summary = l10n_util::GetStringUTF16(summary_id); |
security_description->details = l10n_util::GetStringUTF16(details_id); |
return security_description; |
} |
} // namespace |
-WebsiteSettingsUI::CookieInfo::CookieInfo() : allowed(-1), blocked(-1) {} |
+PageInfoUI::CookieInfo::CookieInfo() : allowed(-1), blocked(-1) {} |
-WebsiteSettingsUI::PermissionInfo::PermissionInfo() |
+PageInfoUI::PermissionInfo::PermissionInfo() |
: type(CONTENT_SETTINGS_TYPE_DEFAULT), |
setting(CONTENT_SETTING_DEFAULT), |
default_setting(CONTENT_SETTING_DEFAULT), |
source(content_settings::SETTING_SOURCE_NONE), |
is_incognito(false) {} |
-WebsiteSettingsUI::ChosenObjectInfo::ChosenObjectInfo( |
- const WebsiteSettings::ChooserUIInfo& ui_info, |
+PageInfoUI::ChosenObjectInfo::ChosenObjectInfo( |
+ const PageInfo::ChooserUIInfo& ui_info, |
std::unique_ptr<base::DictionaryValue> object) |
: ui_info(ui_info), object(std::move(object)) {} |
-WebsiteSettingsUI::ChosenObjectInfo::~ChosenObjectInfo() {} |
+PageInfoUI::ChosenObjectInfo::~ChosenObjectInfo() {} |
-WebsiteSettingsUI::IdentityInfo::IdentityInfo() |
- : identity_status(WebsiteSettings::SITE_IDENTITY_STATUS_UNKNOWN), |
- connection_status(WebsiteSettings::SITE_CONNECTION_STATUS_UNKNOWN), |
+PageInfoUI::IdentityInfo::IdentityInfo() |
+ : identity_status(PageInfo::SITE_IDENTITY_STATUS_UNKNOWN), |
+ connection_status(PageInfo::SITE_CONNECTION_STATUS_UNKNOWN), |
show_ssl_decision_revoke_button(false) {} |
-WebsiteSettingsUI::IdentityInfo::~IdentityInfo() {} |
+PageInfoUI::IdentityInfo::~IdentityInfo() {} |
-std::unique_ptr<WebsiteSettingsUI::SecurityDescription> |
-WebsiteSettingsUI::IdentityInfo::GetSecurityDescription() const { |
- std::unique_ptr<WebsiteSettingsUI::SecurityDescription> security_description( |
- new WebsiteSettingsUI::SecurityDescription()); |
+std::unique_ptr<PageInfoUI::SecurityDescription> |
+PageInfoUI::IdentityInfo::GetSecurityDescription() const { |
+ std::unique_ptr<PageInfoUI::SecurityDescription> security_description( |
+ new PageInfoUI::SecurityDescription()); |
switch (identity_status) { |
- case WebsiteSettings::SITE_IDENTITY_STATUS_INTERNAL_PAGE: |
+ case PageInfo::SITE_IDENTITY_STATUS_INTERNAL_PAGE: |
// Internal pages have their own UI implementations which should never |
// call this function. |
NOTREACHED(); |
- 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_ADMIN_PROVIDED_CERT: |
+ case PageInfo::SITE_IDENTITY_STATUS_CERT: |
+ case PageInfo::SITE_IDENTITY_STATUS_EV_CERT: |
+ case PageInfo::SITE_IDENTITY_STATUS_CERT_REVOCATION_UNKNOWN: |
+ case PageInfo::SITE_IDENTITY_STATUS_ADMIN_PROVIDED_CERT: |
switch (connection_status) { |
- case WebsiteSettings:: |
- SITE_CONNECTION_STATUS_INSECURE_ACTIVE_SUBRESOURCE: |
+ case PageInfo::SITE_CONNECTION_STATUS_INSECURE_ACTIVE_SUBRESOURCE: |
return CreateSecurityDescription(IDS_PAGEINFO_NOT_SECURE_SUMMARY, |
IDS_PAGEINFO_NOT_SECURE_DETAILS); |
- case WebsiteSettings:: |
- SITE_CONNECTION_STATUS_INSECURE_PASSIVE_SUBRESOURCE: |
+ case PageInfo::SITE_CONNECTION_STATUS_INSECURE_PASSIVE_SUBRESOURCE: |
return CreateSecurityDescription(IDS_PAGEINFO_MIXED_CONTENT_SUMMARY, |
IDS_PAGEINFO_MIXED_CONTENT_DETAILS); |
default: |
return CreateSecurityDescription(IDS_PAGEINFO_SECURE_SUMMARY, |
IDS_PAGEINFO_SECURE_DETAILS); |
} |
- case WebsiteSettings::SITE_IDENTITY_STATUS_MALWARE: |
+ case PageInfo::SITE_IDENTITY_STATUS_MALWARE: |
return CreateSecurityDescription(IDS_PAGEINFO_MALWARE_SUMMARY, |
IDS_PAGEINFO_MALWARE_DETAILS); |
- case WebsiteSettings::SITE_IDENTITY_STATUS_SOCIAL_ENGINEERING: |
+ case PageInfo::SITE_IDENTITY_STATUS_SOCIAL_ENGINEERING: |
return CreateSecurityDescription(IDS_PAGEINFO_SOCIAL_ENGINEERING_SUMMARY, |
IDS_PAGEINFO_SOCIAL_ENGINEERING_DETAILS); |
- case WebsiteSettings::SITE_IDENTITY_STATUS_UNWANTED_SOFTWARE: |
+ case PageInfo::SITE_IDENTITY_STATUS_UNWANTED_SOFTWARE: |
return CreateSecurityDescription(IDS_PAGEINFO_UNWANTED_SOFTWARE_SUMMARY, |
IDS_PAGEINFO_UNWANTED_SOFTWARE_DETAILS); |
- case WebsiteSettings::SITE_IDENTITY_STATUS_DEPRECATED_SIGNATURE_ALGORITHM: |
- case WebsiteSettings::SITE_IDENTITY_STATUS_UNKNOWN: |
- case WebsiteSettings::SITE_IDENTITY_STATUS_NO_CERT: |
+ case PageInfo::SITE_IDENTITY_STATUS_DEPRECATED_SIGNATURE_ALGORITHM: |
+ case PageInfo::SITE_IDENTITY_STATUS_UNKNOWN: |
+ case PageInfo::SITE_IDENTITY_STATUS_NO_CERT: |
default: |
return CreateSecurityDescription(IDS_PAGEINFO_NOT_SECURE_SUMMARY, |
IDS_PAGEINFO_NOT_SECURE_DETAILS); |
} |
} |
-WebsiteSettingsUI::~WebsiteSettingsUI() {} |
+PageInfoUI::~PageInfoUI() {} |
// static |
-base::string16 WebsiteSettingsUI::PermissionTypeToUIString( |
- ContentSettingsType type) { |
+base::string16 PageInfoUI::PermissionTypeToUIString(ContentSettingsType type) { |
for (const PermissionsUIInfo& info : kPermissionsUIInfo) { |
if (info.type == type) |
return l10n_util::GetStringUTF16(info.string_id); |
@@ -209,8 +207,7 @@ base::string16 WebsiteSettingsUI::PermissionTypeToUIString( |
} |
// static |
-base::string16 WebsiteSettingsUI::PermissionValueToUIString( |
- ContentSetting value) { |
+base::string16 PageInfoUI::PermissionValueToUIString(ContentSetting value) { |
switch (value) { |
case CONTENT_SETTING_ALLOW: |
return l10n_util::GetStringUTF16(IDS_WEBSITE_SETTINGS_PERMISSION_ALLOW); |
@@ -225,7 +222,7 @@ base::string16 WebsiteSettingsUI::PermissionValueToUIString( |
} |
// static |
-base::string16 WebsiteSettingsUI::PermissionActionToUIString( |
+base::string16 PageInfoUI::PermissionActionToUIString( |
Profile* profile, |
ContentSettingsType type, |
ContentSetting setting, |
@@ -276,8 +273,8 @@ base::string16 WebsiteSettingsUI::PermissionActionToUIString( |
} |
// static |
-int WebsiteSettingsUI::GetPermissionIconID(ContentSettingsType type, |
- ContentSetting setting) { |
+int PageInfoUI::GetPermissionIconID(ContentSettingsType type, |
+ ContentSetting setting) { |
bool use_blocked = (setting == CONTENT_SETTING_BLOCK); |
for (const PermissionsUIInfo& info : kPermissionsUIInfo) { |
if (info.type == type) |
@@ -288,8 +285,7 @@ int WebsiteSettingsUI::GetPermissionIconID(ContentSettingsType type, |
} |
// static |
-const gfx::Image& WebsiteSettingsUI::GetPermissionIcon( |
- const PermissionInfo& info) { |
+const gfx::Image& PageInfoUI::GetPermissionIcon(const PermissionInfo& info) { |
ContentSetting setting = info.setting; |
if (setting == CONTENT_SETTING_DEFAULT) |
setting = info.default_setting; |
@@ -298,7 +294,7 @@ const gfx::Image& WebsiteSettingsUI::GetPermissionIcon( |
} |
// static |
-base::string16 WebsiteSettingsUI::ChosenObjectToUIString( |
+base::string16 PageInfoUI::ChosenObjectToUIString( |
const ChosenObjectInfo& object) { |
base::string16 name; |
object.object->GetString(object.ui_info.ui_name_key, &name); |
@@ -306,7 +302,7 @@ base::string16 WebsiteSettingsUI::ChosenObjectToUIString( |
} |
// static |
-const gfx::Image& WebsiteSettingsUI::GetChosenObjectIcon( |
+const gfx::Image& PageInfoUI::GetChosenObjectIcon( |
const ChosenObjectInfo& object, |
bool deleted) { |
ResourceBundle& rb = ResourceBundle::GetSharedInstance(); |
@@ -315,30 +311,29 @@ const gfx::Image& WebsiteSettingsUI::GetChosenObjectIcon( |
} |
// static |
-int WebsiteSettingsUI::GetIdentityIconID( |
- WebsiteSettings::SiteIdentityStatus status) { |
+int PageInfoUI::GetIdentityIconID(PageInfo::SiteIdentityStatus status) { |
int resource_id = IDR_PAGEINFO_INFO; |
switch (status) { |
- case WebsiteSettings::SITE_IDENTITY_STATUS_UNKNOWN: |
- case WebsiteSettings::SITE_IDENTITY_STATUS_INTERNAL_PAGE: |
+ case PageInfo::SITE_IDENTITY_STATUS_UNKNOWN: |
+ case PageInfo::SITE_IDENTITY_STATUS_INTERNAL_PAGE: |
break; |
- case WebsiteSettings::SITE_IDENTITY_STATUS_CERT: |
- case WebsiteSettings::SITE_IDENTITY_STATUS_EV_CERT: |
+ case PageInfo::SITE_IDENTITY_STATUS_CERT: |
+ case PageInfo::SITE_IDENTITY_STATUS_EV_CERT: |
resource_id = IDR_PAGEINFO_GOOD; |
break; |
- case WebsiteSettings::SITE_IDENTITY_STATUS_CERT_REVOCATION_UNKNOWN: |
+ case PageInfo::SITE_IDENTITY_STATUS_CERT_REVOCATION_UNKNOWN: |
resource_id = IDR_PAGEINFO_WARNING_MINOR; |
break; |
- case WebsiteSettings::SITE_IDENTITY_STATUS_NO_CERT: |
+ case PageInfo::SITE_IDENTITY_STATUS_NO_CERT: |
resource_id = IDR_PAGEINFO_WARNING_MAJOR; |
break; |
- case WebsiteSettings::SITE_IDENTITY_STATUS_ERROR: |
+ case PageInfo::SITE_IDENTITY_STATUS_ERROR: |
resource_id = IDR_PAGEINFO_BAD; |
break; |
- case WebsiteSettings::SITE_IDENTITY_STATUS_ADMIN_PROVIDED_CERT: |
+ case PageInfo::SITE_IDENTITY_STATUS_ADMIN_PROVIDED_CERT: |
resource_id = IDR_PAGEINFO_ENTERPRISE_MANAGED; |
break; |
- case WebsiteSettings::SITE_IDENTITY_STATUS_DEPRECATED_SIGNATURE_ALGORITHM: |
+ case PageInfo::SITE_IDENTITY_STATUS_DEPRECATED_SIGNATURE_ALGORITHM: |
resource_id = IDR_PAGEINFO_WARNING_MINOR; |
break; |
default: |
@@ -349,31 +344,30 @@ int WebsiteSettingsUI::GetIdentityIconID( |
} |
// static |
-const gfx::Image& WebsiteSettingsUI::GetIdentityIcon( |
- WebsiteSettings::SiteIdentityStatus status) { |
+const gfx::Image& PageInfoUI::GetIdentityIcon( |
+ PageInfo::SiteIdentityStatus status) { |
ResourceBundle& rb = ResourceBundle::GetSharedInstance(); |
return rb.GetNativeImageNamed(GetIdentityIconID(status)); |
} |
// static |
-int WebsiteSettingsUI::GetConnectionIconID( |
- WebsiteSettings::SiteConnectionStatus status) { |
+int PageInfoUI::GetConnectionIconID(PageInfo::SiteConnectionStatus status) { |
int resource_id = IDR_PAGEINFO_INFO; |
switch (status) { |
- case WebsiteSettings::SITE_CONNECTION_STATUS_UNKNOWN: |
- case WebsiteSettings::SITE_CONNECTION_STATUS_INTERNAL_PAGE: |
+ case PageInfo::SITE_CONNECTION_STATUS_UNKNOWN: |
+ case PageInfo::SITE_CONNECTION_STATUS_INTERNAL_PAGE: |
break; |
- case WebsiteSettings::SITE_CONNECTION_STATUS_ENCRYPTED: |
+ case PageInfo::SITE_CONNECTION_STATUS_ENCRYPTED: |
resource_id = IDR_PAGEINFO_GOOD; |
break; |
- case WebsiteSettings::SITE_CONNECTION_STATUS_INSECURE_PASSIVE_SUBRESOURCE: |
+ case PageInfo::SITE_CONNECTION_STATUS_INSECURE_PASSIVE_SUBRESOURCE: |
resource_id = IDR_PAGEINFO_WARNING_MINOR; |
break; |
- case WebsiteSettings::SITE_CONNECTION_STATUS_UNENCRYPTED: |
+ case PageInfo::SITE_CONNECTION_STATUS_UNENCRYPTED: |
resource_id = IDR_PAGEINFO_WARNING_MAJOR; |
break; |
- case WebsiteSettings::SITE_CONNECTION_STATUS_INSECURE_ACTIVE_SUBRESOURCE: |
- case WebsiteSettings::SITE_CONNECTION_STATUS_ENCRYPTED_ERROR: |
+ case PageInfo::SITE_CONNECTION_STATUS_INSECURE_ACTIVE_SUBRESOURCE: |
+ case PageInfo::SITE_CONNECTION_STATUS_ENCRYPTED_ERROR: |
resource_id = IDR_PAGEINFO_BAD; |
break; |
} |
@@ -381,8 +375,8 @@ int WebsiteSettingsUI::GetConnectionIconID( |
} |
// static |
-const gfx::Image& WebsiteSettingsUI::GetConnectionIcon( |
- WebsiteSettings::SiteConnectionStatus status) { |
+const gfx::Image& PageInfoUI::GetConnectionIcon( |
+ PageInfo::SiteConnectionStatus status) { |
ResourceBundle& rb = ResourceBundle::GetSharedInstance(); |
return rb.GetNativeImageNamed(GetConnectionIconID(status)); |
} |