Chromium Code Reviews| 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 "chrome/grit/chromium_strings.h" | 7 #include "chrome/grit/chromium_strings.h" |
| 8 #include "chrome/grit/generated_resources.h" | 8 #include "chrome/grit/generated_resources.h" |
| 9 #include "grit/theme_resources.h" | 9 #include "grit/theme_resources.h" |
| 10 #include "ui/base/l10n/l10n_util.h" | 10 #include "ui/base/l10n/l10n_util.h" |
| (...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 272 resource_id = IDR_PAGEINFO_BAD; | 272 resource_id = IDR_PAGEINFO_BAD; |
| 273 break; | 273 break; |
| 274 case WebsiteSettings::SITE_IDENTITY_STATUS_ADMIN_PROVIDED_CERT: | 274 case WebsiteSettings::SITE_IDENTITY_STATUS_ADMIN_PROVIDED_CERT: |
| 275 resource_id = IDR_PAGEINFO_ENTERPRISE_MANAGED; | 275 resource_id = IDR_PAGEINFO_ENTERPRISE_MANAGED; |
| 276 break; | 276 break; |
| 277 case WebsiteSettings::SITE_IDENTITY_STATUS_DEPRECATED_SIGNATURE_ALGORITHM: | 277 case WebsiteSettings::SITE_IDENTITY_STATUS_DEPRECATED_SIGNATURE_ALGORITHM: |
| 278 resource_id = IDR_PAGEINFO_WARNING_MINOR; | 278 resource_id = IDR_PAGEINFO_WARNING_MINOR; |
| 279 break; | 279 break; |
| 280 default: | 280 default: |
| 281 NOTREACHED(); | 281 NOTREACHED(); |
| 282 break; | 282 break; |
|
Finnur
2014/10/21 15:49:34
I would delete this default: case.
If you do, you
sashab
2014/10/22 09:35:00
Added INTERNAL_PAGE to have IDR_PAGEINFO_INFO. The
| |
| 283 } | 283 } |
| 284 return resource_id; | 284 return resource_id; |
| 285 } | 285 } |
| 286 | 286 |
| 287 // static | 287 // static |
| 288 const gfx::Image& WebsiteSettingsUI::GetIdentityIcon( | 288 const gfx::Image& WebsiteSettingsUI::GetIdentityIcon( |
| 289 WebsiteSettings::SiteIdentityStatus status) { | 289 WebsiteSettings::SiteIdentityStatus status) { |
| 290 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); | 290 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); |
| 291 return rb.GetNativeImageNamed(GetIdentityIconID(status)); | 291 return rb.GetNativeImageNamed(GetIdentityIconID(status)); |
| 292 } | 292 } |
| (...skipping 12 matching lines...) Expand all Loading... | |
| 305 resource_id = IDR_PAGEINFO_WARNING_MINOR; | 305 resource_id = IDR_PAGEINFO_WARNING_MINOR; |
| 306 break; | 306 break; |
| 307 case WebsiteSettings::SITE_CONNECTION_STATUS_UNENCRYPTED: | 307 case WebsiteSettings::SITE_CONNECTION_STATUS_UNENCRYPTED: |
| 308 resource_id = IDR_PAGEINFO_WARNING_MAJOR; | 308 resource_id = IDR_PAGEINFO_WARNING_MAJOR; |
| 309 break; | 309 break; |
| 310 case WebsiteSettings::SITE_CONNECTION_STATUS_ENCRYPTED_ERROR: | 310 case WebsiteSettings::SITE_CONNECTION_STATUS_ENCRYPTED_ERROR: |
| 311 resource_id = IDR_PAGEINFO_BAD; | 311 resource_id = IDR_PAGEINFO_BAD; |
| 312 break; | 312 break; |
| 313 default: | 313 default: |
| 314 NOTREACHED(); | 314 NOTREACHED(); |
| 315 break; | 315 break; |
|
Finnur
2014/10/21 15:49:34
Also delete this default case. Then you'll find th
sashab
2014/10/22 09:35:00
Done.
| |
| 316 } | 316 } |
| 317 return resource_id; | 317 return resource_id; |
| 318 } | 318 } |
| 319 | 319 |
| 320 // static | 320 // static |
| 321 const gfx::Image& WebsiteSettingsUI::GetConnectionIcon( | 321 const gfx::Image& WebsiteSettingsUI::GetConnectionIcon( |
| 322 WebsiteSettings::SiteConnectionStatus status) { | 322 WebsiteSettings::SiteConnectionStatus status) { |
| 323 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); | 323 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); |
| 324 return rb.GetNativeImageNamed(GetConnectionIconID(status)); | 324 return rb.GetNativeImageNamed(GetConnectionIconID(status)); |
| 325 } | 325 } |
| 326 | 326 |
| 327 // static | 327 // static |
| 328 int WebsiteSettingsUI::GetFirstVisitIconID(const base::string16& first_visit) { | 328 int WebsiteSettingsUI::GetFirstVisitIconID(const base::string16& first_visit) { |
| 329 // FIXME(markusheintz): Display a minor warning icon if the page is visited | 329 // FIXME(markusheintz): Display a minor warning icon if the page is visited |
| 330 // the first time. | 330 // the first time. |
| 331 return IDR_PAGEINFO_INFO; | 331 return IDR_PAGEINFO_INFO; |
| 332 } | 332 } |
| 333 | 333 |
| 334 // static | 334 // static |
| 335 const gfx::Image& WebsiteSettingsUI::GetFirstVisitIcon( | 335 const gfx::Image& WebsiteSettingsUI::GetFirstVisitIcon( |
| 336 const base::string16& first_visit) { | 336 const base::string16& first_visit) { |
| 337 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); | 337 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); |
| 338 return rb.GetNativeImageNamed(GetFirstVisitIconID(first_visit)); | 338 return rb.GetNativeImageNamed(GetFirstVisitIconID(first_visit)); |
| 339 } | 339 } |
| 340 | |
| 341 // static | |
| 342 int WebsiteSettingsUI::GetConnectionSummaryMessageID( | |
| 343 WebsiteSettings::SiteConnectionStatus status) { | |
| 344 switch (status) { | |
| 345 case WebsiteSettings::SITE_CONNECTION_STATUS_UNKNOWN: | |
| 346 return IDS_PAGE_INFO_UNENCRYPTED_CONNECTION_SUMMARY_TEXT; | |
| 347 case WebsiteSettings::SITE_CONNECTION_STATUS_ENCRYPTED: | |
| 348 return IDS_PAGE_INFO_ENCRYPTED_CONNECTION_SUMMARY_TEXT; | |
| 349 case WebsiteSettings::SITE_CONNECTION_STATUS_MIXED_CONTENT: | |
| 350 return IDS_PAGE_INFO_MIXED_CONTENT_CONNECTION_SUMMARY_TEXT; | |
| 351 case WebsiteSettings::SITE_CONNECTION_STATUS_UNENCRYPTED: | |
| 352 return IDS_PAGE_INFO_UNENCRYPTED_CONNECTION_SUMMARY_TEXT; | |
| 353 case WebsiteSettings::SITE_CONNECTION_STATUS_ENCRYPTED_ERROR: | |
| 354 return IDS_PAGE_INFO_UNENCRYPTED_CONNECTION_SUMMARY_TEXT; | |
| 355 case WebsiteSettings::SITE_CONNECTION_STATUS_INTERNAL_PAGE: | |
| 356 return IDS_PAGE_INFO_INTERNAL_PAGE; | |
| 357 default: | |
| 358 NOTREACHED(); | |
| 359 return 0; | |
| 360 } | |
| 361 } | |
| OLD | NEW |