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/generated_resources.h" | 7 #include "grit/chromium_strings.h" |
8 #include "grit/generated_resources.h" | |
8 #include "grit/theme_resources.h" | 9 #include "grit/theme_resources.h" |
9 #include "ui/base/l10n/l10n_util.h" | 10 #include "ui/base/l10n/l10n_util.h" |
10 #include "ui/base/resource/resource_bundle.h" | 11 #include "ui/base/resource/resource_bundle.h" |
11 #include "ui/gfx/image/image.h" | 12 #include "ui/gfx/image/image.h" |
12 | 13 |
13 namespace { | 14 namespace { |
14 | 15 |
15 const int kInvalidResourceID = -1; | 16 const int kInvalidResourceID = -1; |
16 | 17 |
17 // The resource id's for the strings that are displayed on the permissions | 18 // The resource id's for the strings that are displayed on the permissions |
(...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
326 // the first time. | 327 // the first time. |
327 return IDR_PAGEINFO_INFO; | 328 return IDR_PAGEINFO_INFO; |
328 } | 329 } |
329 | 330 |
330 // static | 331 // static |
331 const gfx::Image& WebsiteSettingsUI::GetFirstVisitIcon( | 332 const gfx::Image& WebsiteSettingsUI::GetFirstVisitIcon( |
332 const base::string16& first_visit) { | 333 const base::string16& first_visit) { |
333 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); | 334 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); |
334 return rb.GetNativeImageNamed(GetFirstVisitIconID(first_visit)); | 335 return rb.GetNativeImageNamed(GetFirstVisitIconID(first_visit)); |
335 } | 336 } |
337 | |
338 // static | |
339 int WebsiteSettingsUI::GetConnectionSummaryMessageID( | |
340 WebsiteSettings::SiteConnectionStatus status) { | |
341 int resource_id = IDS_PAGE_INFO_UNKNOWN_CONNECTION_SUMMARY_TEXT; | |
342 switch (status) { | |
343 case WebsiteSettings::SITE_CONNECTION_STATUS_UNKNOWN: | |
344 resource_id = IDS_PAGE_INFO_UNKNOWN_CONNECTION_SUMMARY_TEXT; | |
Ted C
2014/09/23 03:56:16
Instead of keeping a resource_id reference, I woul
sashab
2014/09/29 04:17:12
No prob - was copying from above but they are actu
| |
345 break; | |
346 case WebsiteSettings::SITE_CONNECTION_STATUS_ENCRYPTED: | |
347 resource_id = IDS_PAGE_INFO_ENCRYPTED_CONNECTION_SUMMARY_TEXT; | |
348 break; | |
349 case WebsiteSettings::SITE_CONNECTION_STATUS_MIXED_CONTENT: | |
350 resource_id = IDS_PAGE_INFO_MIXED_CONTENT_CONNECTION_SUMMARY_TEXT; | |
351 break; | |
352 case WebsiteSettings::SITE_CONNECTION_STATUS_UNENCRYPTED: | |
353 resource_id = IDS_PAGE_INFO_UNENCRYPTED_CONNECTION_SUMMARY_TEXT; | |
354 break; | |
355 case WebsiteSettings::SITE_CONNECTION_STATUS_ENCRYPTED_ERROR: | |
356 resource_id = IDS_PAGE_INFO_UNKNOWN_CONNECTION_SUMMARY_TEXT; | |
357 break; | |
358 case WebsiteSettings::SITE_CONNECTION_STATUS_INTERNAL_PAGE: | |
359 resource_id = IDS_PAGE_INFO_INTERNAL_PAGE; | |
360 break; | |
361 default: | |
362 NOTREACHED(); | |
363 break; | |
364 } | |
365 return resource_id; | |
366 } | |
OLD | NEW |