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/website_settings_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/plugins/plugin_utils.h" | 9 #include "chrome/browser/plugins/plugin_utils.h" |
10 #include "chrome/browser/plugins/plugins_field_trial.h" | 10 #include "chrome/browser/plugins/plugins_field_trial.h" |
11 #include "chrome/common/chrome_features.h" | 11 #include "chrome/common/chrome_features.h" |
12 #include "chrome/grit/chromium_strings.h" | 12 #include "chrome/grit/chromium_strings.h" |
13 #include "chrome/grit/generated_resources.h" | 13 #include "chrome/grit/generated_resources.h" |
14 #include "chrome/grit/theme_resources.h" | 14 #include "chrome/grit/theme_resources.h" |
15 #include "components/strings/grit/components_strings.h" | 15 #include "components/strings/grit/components_strings.h" |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 {CONTENT_SETTINGS_TYPE_MIDI_SYSEX, IDS_WEBSITE_SETTINGS_TYPE_MIDI_SYSEX, | 110 {CONTENT_SETTINGS_TYPE_MIDI_SYSEX, IDS_WEBSITE_SETTINGS_TYPE_MIDI_SYSEX, |
111 IDR_BLOCKED_MIDI_SYSEX, IDR_ALLOWED_MIDI_SYSEX}, | 111 IDR_BLOCKED_MIDI_SYSEX, IDR_ALLOWED_MIDI_SYSEX}, |
112 {CONTENT_SETTINGS_TYPE_BACKGROUND_SYNC, | 112 {CONTENT_SETTINGS_TYPE_BACKGROUND_SYNC, |
113 IDS_WEBSITE_SETTINGS_TYPE_BACKGROUND_SYNC, IDR_BLOCKED_BACKGROUND_SYNC, | 113 IDS_WEBSITE_SETTINGS_TYPE_BACKGROUND_SYNC, IDR_BLOCKED_BACKGROUND_SYNC, |
114 IDR_ALLOWED_BACKGROUND_SYNC}, | 114 IDR_ALLOWED_BACKGROUND_SYNC}, |
115 // Autoplay is Android-only at the moment, and the Origin Info bubble in | 115 // Autoplay is Android-only at the moment, and the Origin Info bubble in |
116 // Android ignores these block/allow icon pairs, so we can specify 0 there. | 116 // Android ignores these block/allow icon pairs, so we can specify 0 there. |
117 {CONTENT_SETTINGS_TYPE_AUTOPLAY, IDS_WEBSITE_SETTINGS_TYPE_AUTOPLAY, 0, 0}, | 117 {CONTENT_SETTINGS_TYPE_AUTOPLAY, IDS_WEBSITE_SETTINGS_TYPE_AUTOPLAY, 0, 0}, |
118 }; | 118 }; |
119 | 119 |
120 std::unique_ptr<WebsiteSettingsUI::SecurityDescription> | 120 std::unique_ptr<PageInfoUI::SecurityDescription> CreateSecurityDescription( |
121 CreateSecurityDescription(int summary_id, int details_id) { | 121 int summary_id, |
122 std::unique_ptr<WebsiteSettingsUI::SecurityDescription> security_description( | 122 int details_id) { |
123 new WebsiteSettingsUI::SecurityDescription()); | 123 std::unique_ptr<PageInfoUI::SecurityDescription> security_description( |
| 124 new PageInfoUI::SecurityDescription()); |
124 security_description->summary = l10n_util::GetStringUTF16(summary_id); | 125 security_description->summary = l10n_util::GetStringUTF16(summary_id); |
125 security_description->details = l10n_util::GetStringUTF16(details_id); | 126 security_description->details = l10n_util::GetStringUTF16(details_id); |
126 return security_description; | 127 return security_description; |
127 } | 128 } |
128 } // namespace | 129 } // namespace |
129 | 130 |
130 WebsiteSettingsUI::CookieInfo::CookieInfo() : allowed(-1), blocked(-1) {} | 131 PageInfoUI::CookieInfo::CookieInfo() : allowed(-1), blocked(-1) {} |
131 | 132 |
132 WebsiteSettingsUI::PermissionInfo::PermissionInfo() | 133 PageInfoUI::PermissionInfo::PermissionInfo() |
133 : type(CONTENT_SETTINGS_TYPE_DEFAULT), | 134 : type(CONTENT_SETTINGS_TYPE_DEFAULT), |
134 setting(CONTENT_SETTING_DEFAULT), | 135 setting(CONTENT_SETTING_DEFAULT), |
135 default_setting(CONTENT_SETTING_DEFAULT), | 136 default_setting(CONTENT_SETTING_DEFAULT), |
136 source(content_settings::SETTING_SOURCE_NONE), | 137 source(content_settings::SETTING_SOURCE_NONE), |
137 is_incognito(false) {} | 138 is_incognito(false) {} |
138 | 139 |
139 WebsiteSettingsUI::ChosenObjectInfo::ChosenObjectInfo( | 140 PageInfoUI::ChosenObjectInfo::ChosenObjectInfo( |
140 const WebsiteSettings::ChooserUIInfo& ui_info, | 141 const PageInfo::ChooserUIInfo& ui_info, |
141 std::unique_ptr<base::DictionaryValue> object) | 142 std::unique_ptr<base::DictionaryValue> object) |
142 : ui_info(ui_info), object(std::move(object)) {} | 143 : ui_info(ui_info), object(std::move(object)) {} |
143 | 144 |
144 WebsiteSettingsUI::ChosenObjectInfo::~ChosenObjectInfo() {} | 145 PageInfoUI::ChosenObjectInfo::~ChosenObjectInfo() {} |
145 | 146 |
146 WebsiteSettingsUI::IdentityInfo::IdentityInfo() | 147 PageInfoUI::IdentityInfo::IdentityInfo() |
147 : identity_status(WebsiteSettings::SITE_IDENTITY_STATUS_UNKNOWN), | 148 : identity_status(PageInfo::SITE_IDENTITY_STATUS_UNKNOWN), |
148 connection_status(WebsiteSettings::SITE_CONNECTION_STATUS_UNKNOWN), | 149 connection_status(PageInfo::SITE_CONNECTION_STATUS_UNKNOWN), |
149 show_ssl_decision_revoke_button(false) {} | 150 show_ssl_decision_revoke_button(false) {} |
150 | 151 |
151 WebsiteSettingsUI::IdentityInfo::~IdentityInfo() {} | 152 PageInfoUI::IdentityInfo::~IdentityInfo() {} |
152 | 153 |
153 std::unique_ptr<WebsiteSettingsUI::SecurityDescription> | 154 std::unique_ptr<PageInfoUI::SecurityDescription> |
154 WebsiteSettingsUI::IdentityInfo::GetSecurityDescription() const { | 155 PageInfoUI::IdentityInfo::GetSecurityDescription() const { |
155 std::unique_ptr<WebsiteSettingsUI::SecurityDescription> security_description( | 156 std::unique_ptr<PageInfoUI::SecurityDescription> security_description( |
156 new WebsiteSettingsUI::SecurityDescription()); | 157 new PageInfoUI::SecurityDescription()); |
157 | 158 |
158 switch (identity_status) { | 159 switch (identity_status) { |
159 case WebsiteSettings::SITE_IDENTITY_STATUS_INTERNAL_PAGE: | 160 case PageInfo::SITE_IDENTITY_STATUS_INTERNAL_PAGE: |
160 // Internal pages have their own UI implementations which should never | 161 // Internal pages have their own UI implementations which should never |
161 // call this function. | 162 // call this function. |
162 NOTREACHED(); | 163 NOTREACHED(); |
163 case WebsiteSettings::SITE_IDENTITY_STATUS_CERT: | 164 case PageInfo::SITE_IDENTITY_STATUS_CERT: |
164 case WebsiteSettings::SITE_IDENTITY_STATUS_EV_CERT: | 165 case PageInfo::SITE_IDENTITY_STATUS_EV_CERT: |
165 case WebsiteSettings::SITE_IDENTITY_STATUS_CERT_REVOCATION_UNKNOWN: | 166 case PageInfo::SITE_IDENTITY_STATUS_CERT_REVOCATION_UNKNOWN: |
166 case WebsiteSettings::SITE_IDENTITY_STATUS_ADMIN_PROVIDED_CERT: | 167 case PageInfo::SITE_IDENTITY_STATUS_ADMIN_PROVIDED_CERT: |
167 switch (connection_status) { | 168 switch (connection_status) { |
168 case WebsiteSettings:: | 169 case PageInfo::SITE_CONNECTION_STATUS_INSECURE_ACTIVE_SUBRESOURCE: |
169 SITE_CONNECTION_STATUS_INSECURE_ACTIVE_SUBRESOURCE: | |
170 return CreateSecurityDescription(IDS_PAGEINFO_NOT_SECURE_SUMMARY, | 170 return CreateSecurityDescription(IDS_PAGEINFO_NOT_SECURE_SUMMARY, |
171 IDS_PAGEINFO_NOT_SECURE_DETAILS); | 171 IDS_PAGEINFO_NOT_SECURE_DETAILS); |
172 case WebsiteSettings:: | 172 case PageInfo::SITE_CONNECTION_STATUS_INSECURE_PASSIVE_SUBRESOURCE: |
173 SITE_CONNECTION_STATUS_INSECURE_PASSIVE_SUBRESOURCE: | |
174 return CreateSecurityDescription(IDS_PAGEINFO_MIXED_CONTENT_SUMMARY, | 173 return CreateSecurityDescription(IDS_PAGEINFO_MIXED_CONTENT_SUMMARY, |
175 IDS_PAGEINFO_MIXED_CONTENT_DETAILS); | 174 IDS_PAGEINFO_MIXED_CONTENT_DETAILS); |
176 default: | 175 default: |
177 return CreateSecurityDescription(IDS_PAGEINFO_SECURE_SUMMARY, | 176 return CreateSecurityDescription(IDS_PAGEINFO_SECURE_SUMMARY, |
178 IDS_PAGEINFO_SECURE_DETAILS); | 177 IDS_PAGEINFO_SECURE_DETAILS); |
179 } | 178 } |
180 case WebsiteSettings::SITE_IDENTITY_STATUS_MALWARE: | 179 case PageInfo::SITE_IDENTITY_STATUS_MALWARE: |
181 return CreateSecurityDescription(IDS_PAGEINFO_MALWARE_SUMMARY, | 180 return CreateSecurityDescription(IDS_PAGEINFO_MALWARE_SUMMARY, |
182 IDS_PAGEINFO_MALWARE_DETAILS); | 181 IDS_PAGEINFO_MALWARE_DETAILS); |
183 case WebsiteSettings::SITE_IDENTITY_STATUS_SOCIAL_ENGINEERING: | 182 case PageInfo::SITE_IDENTITY_STATUS_SOCIAL_ENGINEERING: |
184 return CreateSecurityDescription(IDS_PAGEINFO_SOCIAL_ENGINEERING_SUMMARY, | 183 return CreateSecurityDescription(IDS_PAGEINFO_SOCIAL_ENGINEERING_SUMMARY, |
185 IDS_PAGEINFO_SOCIAL_ENGINEERING_DETAILS); | 184 IDS_PAGEINFO_SOCIAL_ENGINEERING_DETAILS); |
186 case WebsiteSettings::SITE_IDENTITY_STATUS_UNWANTED_SOFTWARE: | 185 case PageInfo::SITE_IDENTITY_STATUS_UNWANTED_SOFTWARE: |
187 return CreateSecurityDescription(IDS_PAGEINFO_UNWANTED_SOFTWARE_SUMMARY, | 186 return CreateSecurityDescription(IDS_PAGEINFO_UNWANTED_SOFTWARE_SUMMARY, |
188 IDS_PAGEINFO_UNWANTED_SOFTWARE_DETAILS); | 187 IDS_PAGEINFO_UNWANTED_SOFTWARE_DETAILS); |
189 case WebsiteSettings::SITE_IDENTITY_STATUS_DEPRECATED_SIGNATURE_ALGORITHM: | 188 case PageInfo::SITE_IDENTITY_STATUS_DEPRECATED_SIGNATURE_ALGORITHM: |
190 case WebsiteSettings::SITE_IDENTITY_STATUS_UNKNOWN: | 189 case PageInfo::SITE_IDENTITY_STATUS_UNKNOWN: |
191 case WebsiteSettings::SITE_IDENTITY_STATUS_NO_CERT: | 190 case PageInfo::SITE_IDENTITY_STATUS_NO_CERT: |
192 default: | 191 default: |
193 return CreateSecurityDescription(IDS_PAGEINFO_NOT_SECURE_SUMMARY, | 192 return CreateSecurityDescription(IDS_PAGEINFO_NOT_SECURE_SUMMARY, |
194 IDS_PAGEINFO_NOT_SECURE_DETAILS); | 193 IDS_PAGEINFO_NOT_SECURE_DETAILS); |
195 } | 194 } |
196 } | 195 } |
197 | 196 |
198 WebsiteSettingsUI::~WebsiteSettingsUI() {} | 197 PageInfoUI::~PageInfoUI() {} |
199 | 198 |
200 // static | 199 // static |
201 base::string16 WebsiteSettingsUI::PermissionTypeToUIString( | 200 base::string16 PageInfoUI::PermissionTypeToUIString(ContentSettingsType type) { |
202 ContentSettingsType type) { | |
203 for (const PermissionsUIInfo& info : kPermissionsUIInfo) { | 201 for (const PermissionsUIInfo& info : kPermissionsUIInfo) { |
204 if (info.type == type) | 202 if (info.type == type) |
205 return l10n_util::GetStringUTF16(info.string_id); | 203 return l10n_util::GetStringUTF16(info.string_id); |
206 } | 204 } |
207 NOTREACHED(); | 205 NOTREACHED(); |
208 return base::string16(); | 206 return base::string16(); |
209 } | 207 } |
210 | 208 |
211 // static | 209 // static |
212 base::string16 WebsiteSettingsUI::PermissionValueToUIString( | 210 base::string16 PageInfoUI::PermissionValueToUIString(ContentSetting value) { |
213 ContentSetting value) { | |
214 switch (value) { | 211 switch (value) { |
215 case CONTENT_SETTING_ALLOW: | 212 case CONTENT_SETTING_ALLOW: |
216 return l10n_util::GetStringUTF16(IDS_WEBSITE_SETTINGS_PERMISSION_ALLOW); | 213 return l10n_util::GetStringUTF16(IDS_WEBSITE_SETTINGS_PERMISSION_ALLOW); |
217 case CONTENT_SETTING_BLOCK: | 214 case CONTENT_SETTING_BLOCK: |
218 return l10n_util::GetStringUTF16(IDS_WEBSITE_SETTINGS_PERMISSION_BLOCK); | 215 return l10n_util::GetStringUTF16(IDS_WEBSITE_SETTINGS_PERMISSION_BLOCK); |
219 case CONTENT_SETTING_ASK: | 216 case CONTENT_SETTING_ASK: |
220 return l10n_util::GetStringUTF16(IDS_WEBSITE_SETTINGS_PERMISSION_ASK); | 217 return l10n_util::GetStringUTF16(IDS_WEBSITE_SETTINGS_PERMISSION_ASK); |
221 default: | 218 default: |
222 NOTREACHED(); | 219 NOTREACHED(); |
223 return base::string16(); | 220 return base::string16(); |
224 } | 221 } |
225 } | 222 } |
226 | 223 |
227 // static | 224 // static |
228 base::string16 WebsiteSettingsUI::PermissionActionToUIString( | 225 base::string16 PageInfoUI::PermissionActionToUIString( |
229 Profile* profile, | 226 Profile* profile, |
230 ContentSettingsType type, | 227 ContentSettingsType type, |
231 ContentSetting setting, | 228 ContentSetting setting, |
232 ContentSetting default_setting, | 229 ContentSetting default_setting, |
233 content_settings::SettingSource source) { | 230 content_settings::SettingSource source) { |
234 ContentSetting effective_setting = setting; | 231 ContentSetting effective_setting = setting; |
235 if (effective_setting == CONTENT_SETTING_DEFAULT) | 232 if (effective_setting == CONTENT_SETTING_DEFAULT) |
236 effective_setting = default_setting; | 233 effective_setting = default_setting; |
237 | 234 |
238 #if BUILDFLAG(ENABLE_PLUGINS) | 235 #if BUILDFLAG(ENABLE_PLUGINS) |
(...skipping 30 matching lines...) Expand all Loading... |
269 default: | 266 default: |
270 NOTREACHED(); | 267 NOTREACHED(); |
271 return base::string16(); | 268 return base::string16(); |
272 } | 269 } |
273 int button_text_id = button_text_ids[effective_setting]; | 270 int button_text_id = button_text_ids[effective_setting]; |
274 DCHECK_NE(button_text_id, kInvalidResourceID); | 271 DCHECK_NE(button_text_id, kInvalidResourceID); |
275 return l10n_util::GetStringUTF16(button_text_id); | 272 return l10n_util::GetStringUTF16(button_text_id); |
276 } | 273 } |
277 | 274 |
278 // static | 275 // static |
279 int WebsiteSettingsUI::GetPermissionIconID(ContentSettingsType type, | 276 int PageInfoUI::GetPermissionIconID(ContentSettingsType type, |
280 ContentSetting setting) { | 277 ContentSetting setting) { |
281 bool use_blocked = (setting == CONTENT_SETTING_BLOCK); | 278 bool use_blocked = (setting == CONTENT_SETTING_BLOCK); |
282 for (const PermissionsUIInfo& info : kPermissionsUIInfo) { | 279 for (const PermissionsUIInfo& info : kPermissionsUIInfo) { |
283 if (info.type == type) | 280 if (info.type == type) |
284 return use_blocked ? info.blocked_icon_id : info.allowed_icon_id; | 281 return use_blocked ? info.blocked_icon_id : info.allowed_icon_id; |
285 } | 282 } |
286 NOTREACHED(); | 283 NOTREACHED(); |
287 return IDR_INFO; | 284 return IDR_INFO; |
288 } | 285 } |
289 | 286 |
290 // static | 287 // static |
291 const gfx::Image& WebsiteSettingsUI::GetPermissionIcon( | 288 const gfx::Image& PageInfoUI::GetPermissionIcon(const PermissionInfo& info) { |
292 const PermissionInfo& info) { | |
293 ContentSetting setting = info.setting; | 289 ContentSetting setting = info.setting; |
294 if (setting == CONTENT_SETTING_DEFAULT) | 290 if (setting == CONTENT_SETTING_DEFAULT) |
295 setting = info.default_setting; | 291 setting = info.default_setting; |
296 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); | 292 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); |
297 return rb.GetNativeImageNamed(GetPermissionIconID(info.type, setting)); | 293 return rb.GetNativeImageNamed(GetPermissionIconID(info.type, setting)); |
298 } | 294 } |
299 | 295 |
300 // static | 296 // static |
301 base::string16 WebsiteSettingsUI::ChosenObjectToUIString( | 297 base::string16 PageInfoUI::ChosenObjectToUIString( |
302 const ChosenObjectInfo& object) { | 298 const ChosenObjectInfo& object) { |
303 base::string16 name; | 299 base::string16 name; |
304 object.object->GetString(object.ui_info.ui_name_key, &name); | 300 object.object->GetString(object.ui_info.ui_name_key, &name); |
305 return name; | 301 return name; |
306 } | 302 } |
307 | 303 |
308 // static | 304 // static |
309 const gfx::Image& WebsiteSettingsUI::GetChosenObjectIcon( | 305 const gfx::Image& PageInfoUI::GetChosenObjectIcon( |
310 const ChosenObjectInfo& object, | 306 const ChosenObjectInfo& object, |
311 bool deleted) { | 307 bool deleted) { |
312 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); | 308 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); |
313 return rb.GetNativeImageNamed(deleted ? object.ui_info.blocked_icon_id | 309 return rb.GetNativeImageNamed(deleted ? object.ui_info.blocked_icon_id |
314 : object.ui_info.allowed_icon_id); | 310 : object.ui_info.allowed_icon_id); |
315 } | 311 } |
316 | 312 |
317 // static | 313 // static |
318 int WebsiteSettingsUI::GetIdentityIconID( | 314 int PageInfoUI::GetIdentityIconID(PageInfo::SiteIdentityStatus status) { |
319 WebsiteSettings::SiteIdentityStatus status) { | |
320 int resource_id = IDR_PAGEINFO_INFO; | 315 int resource_id = IDR_PAGEINFO_INFO; |
321 switch (status) { | 316 switch (status) { |
322 case WebsiteSettings::SITE_IDENTITY_STATUS_UNKNOWN: | 317 case PageInfo::SITE_IDENTITY_STATUS_UNKNOWN: |
323 case WebsiteSettings::SITE_IDENTITY_STATUS_INTERNAL_PAGE: | 318 case PageInfo::SITE_IDENTITY_STATUS_INTERNAL_PAGE: |
324 break; | 319 break; |
325 case WebsiteSettings::SITE_IDENTITY_STATUS_CERT: | 320 case PageInfo::SITE_IDENTITY_STATUS_CERT: |
326 case WebsiteSettings::SITE_IDENTITY_STATUS_EV_CERT: | 321 case PageInfo::SITE_IDENTITY_STATUS_EV_CERT: |
327 resource_id = IDR_PAGEINFO_GOOD; | 322 resource_id = IDR_PAGEINFO_GOOD; |
328 break; | 323 break; |
329 case WebsiteSettings::SITE_IDENTITY_STATUS_CERT_REVOCATION_UNKNOWN: | 324 case PageInfo::SITE_IDENTITY_STATUS_CERT_REVOCATION_UNKNOWN: |
330 resource_id = IDR_PAGEINFO_WARNING_MINOR; | 325 resource_id = IDR_PAGEINFO_WARNING_MINOR; |
331 break; | 326 break; |
332 case WebsiteSettings::SITE_IDENTITY_STATUS_NO_CERT: | 327 case PageInfo::SITE_IDENTITY_STATUS_NO_CERT: |
333 resource_id = IDR_PAGEINFO_WARNING_MAJOR; | 328 resource_id = IDR_PAGEINFO_WARNING_MAJOR; |
334 break; | 329 break; |
335 case WebsiteSettings::SITE_IDENTITY_STATUS_ERROR: | 330 case PageInfo::SITE_IDENTITY_STATUS_ERROR: |
336 resource_id = IDR_PAGEINFO_BAD; | 331 resource_id = IDR_PAGEINFO_BAD; |
337 break; | 332 break; |
338 case WebsiteSettings::SITE_IDENTITY_STATUS_ADMIN_PROVIDED_CERT: | 333 case PageInfo::SITE_IDENTITY_STATUS_ADMIN_PROVIDED_CERT: |
339 resource_id = IDR_PAGEINFO_ENTERPRISE_MANAGED; | 334 resource_id = IDR_PAGEINFO_ENTERPRISE_MANAGED; |
340 break; | 335 break; |
341 case WebsiteSettings::SITE_IDENTITY_STATUS_DEPRECATED_SIGNATURE_ALGORITHM: | 336 case PageInfo::SITE_IDENTITY_STATUS_DEPRECATED_SIGNATURE_ALGORITHM: |
342 resource_id = IDR_PAGEINFO_WARNING_MINOR; | 337 resource_id = IDR_PAGEINFO_WARNING_MINOR; |
343 break; | 338 break; |
344 default: | 339 default: |
345 NOTREACHED(); | 340 NOTREACHED(); |
346 break; | 341 break; |
347 } | 342 } |
348 return resource_id; | 343 return resource_id; |
349 } | 344 } |
350 | 345 |
351 // static | 346 // static |
352 const gfx::Image& WebsiteSettingsUI::GetIdentityIcon( | 347 const gfx::Image& PageInfoUI::GetIdentityIcon( |
353 WebsiteSettings::SiteIdentityStatus status) { | 348 PageInfo::SiteIdentityStatus status) { |
354 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); | 349 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); |
355 return rb.GetNativeImageNamed(GetIdentityIconID(status)); | 350 return rb.GetNativeImageNamed(GetIdentityIconID(status)); |
356 } | 351 } |
357 | 352 |
358 // static | 353 // static |
359 int WebsiteSettingsUI::GetConnectionIconID( | 354 int PageInfoUI::GetConnectionIconID(PageInfo::SiteConnectionStatus status) { |
360 WebsiteSettings::SiteConnectionStatus status) { | |
361 int resource_id = IDR_PAGEINFO_INFO; | 355 int resource_id = IDR_PAGEINFO_INFO; |
362 switch (status) { | 356 switch (status) { |
363 case WebsiteSettings::SITE_CONNECTION_STATUS_UNKNOWN: | 357 case PageInfo::SITE_CONNECTION_STATUS_UNKNOWN: |
364 case WebsiteSettings::SITE_CONNECTION_STATUS_INTERNAL_PAGE: | 358 case PageInfo::SITE_CONNECTION_STATUS_INTERNAL_PAGE: |
365 break; | 359 break; |
366 case WebsiteSettings::SITE_CONNECTION_STATUS_ENCRYPTED: | 360 case PageInfo::SITE_CONNECTION_STATUS_ENCRYPTED: |
367 resource_id = IDR_PAGEINFO_GOOD; | 361 resource_id = IDR_PAGEINFO_GOOD; |
368 break; | 362 break; |
369 case WebsiteSettings::SITE_CONNECTION_STATUS_INSECURE_PASSIVE_SUBRESOURCE: | 363 case PageInfo::SITE_CONNECTION_STATUS_INSECURE_PASSIVE_SUBRESOURCE: |
370 resource_id = IDR_PAGEINFO_WARNING_MINOR; | 364 resource_id = IDR_PAGEINFO_WARNING_MINOR; |
371 break; | 365 break; |
372 case WebsiteSettings::SITE_CONNECTION_STATUS_UNENCRYPTED: | 366 case PageInfo::SITE_CONNECTION_STATUS_UNENCRYPTED: |
373 resource_id = IDR_PAGEINFO_WARNING_MAJOR; | 367 resource_id = IDR_PAGEINFO_WARNING_MAJOR; |
374 break; | 368 break; |
375 case WebsiteSettings::SITE_CONNECTION_STATUS_INSECURE_ACTIVE_SUBRESOURCE: | 369 case PageInfo::SITE_CONNECTION_STATUS_INSECURE_ACTIVE_SUBRESOURCE: |
376 case WebsiteSettings::SITE_CONNECTION_STATUS_ENCRYPTED_ERROR: | 370 case PageInfo::SITE_CONNECTION_STATUS_ENCRYPTED_ERROR: |
377 resource_id = IDR_PAGEINFO_BAD; | 371 resource_id = IDR_PAGEINFO_BAD; |
378 break; | 372 break; |
379 } | 373 } |
380 return resource_id; | 374 return resource_id; |
381 } | 375 } |
382 | 376 |
383 // static | 377 // static |
384 const gfx::Image& WebsiteSettingsUI::GetConnectionIcon( | 378 const gfx::Image& PageInfoUI::GetConnectionIcon( |
385 WebsiteSettings::SiteConnectionStatus status) { | 379 PageInfo::SiteConnectionStatus status) { |
386 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); | 380 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); |
387 return rb.GetNativeImageNamed(GetConnectionIconID(status)); | 381 return rb.GetNativeImageNamed(GetConnectionIconID(status)); |
388 } | 382 } |
OLD | NEW |