Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(183)

Side by Side Diff: chrome/browser/ui/page_info/page_info_ui.cc

Issue 2849713003: Move all Page Info strings into page_info_strings.grdp (Closed)
Patch Set: Fix moar. Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 <utility> 7 #include <utility>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 #endif 209 #endif
210 // Internal pages on desktop have their own UI implementations which 210 // Internal pages on desktop have their own UI implementations which
211 // should never call this function. 211 // should never call this function.
212 NOTREACHED(); 212 NOTREACHED();
213 case PageInfo::SITE_IDENTITY_STATUS_CERT: 213 case PageInfo::SITE_IDENTITY_STATUS_CERT:
214 case PageInfo::SITE_IDENTITY_STATUS_EV_CERT: 214 case PageInfo::SITE_IDENTITY_STATUS_EV_CERT:
215 case PageInfo::SITE_IDENTITY_STATUS_CERT_REVOCATION_UNKNOWN: 215 case PageInfo::SITE_IDENTITY_STATUS_CERT_REVOCATION_UNKNOWN:
216 case PageInfo::SITE_IDENTITY_STATUS_ADMIN_PROVIDED_CERT: 216 case PageInfo::SITE_IDENTITY_STATUS_ADMIN_PROVIDED_CERT:
217 switch (connection_status) { 217 switch (connection_status) {
218 case PageInfo::SITE_CONNECTION_STATUS_INSECURE_ACTIVE_SUBRESOURCE: 218 case PageInfo::SITE_CONNECTION_STATUS_INSECURE_ACTIVE_SUBRESOURCE:
219 return CreateSecurityDescription(IDS_PAGEINFO_NOT_SECURE_SUMMARY, 219 return CreateSecurityDescription(IDS_PAGE_INFO_NOT_SECURE_SUMMARY,
220 IDS_PAGEINFO_NOT_SECURE_DETAILS); 220 IDS_PAGE_INFO_NOT_SECURE_DETAILS);
221 case PageInfo::SITE_CONNECTION_STATUS_INSECURE_FORM_ACTION: 221 case PageInfo::SITE_CONNECTION_STATUS_INSECURE_FORM_ACTION:
222 return CreateSecurityDescription(IDS_PAGEINFO_MIXED_CONTENT_SUMMARY, 222 return CreateSecurityDescription(IDS_PAGE_INFO_MIXED_CONTENT_SUMMARY,
223 IDS_PAGEINFO_NOT_SECURE_DETAILS); 223 IDS_PAGE_INFO_NOT_SECURE_DETAILS);
224 case PageInfo::SITE_CONNECTION_STATUS_INSECURE_PASSIVE_SUBRESOURCE: 224 case PageInfo::SITE_CONNECTION_STATUS_INSECURE_PASSIVE_SUBRESOURCE:
225 return CreateSecurityDescription(IDS_PAGEINFO_MIXED_CONTENT_SUMMARY, 225 return CreateSecurityDescription(IDS_PAGE_INFO_MIXED_CONTENT_SUMMARY,
226 IDS_PAGEINFO_MIXED_CONTENT_DETAILS); 226 IDS_PAGE_INFO_MIXED_CONTENT_DETAILS);
227 default: 227 default:
228 return CreateSecurityDescription(IDS_PAGEINFO_SECURE_SUMMARY, 228 return CreateSecurityDescription(IDS_PAGE_INFO_SECURE_SUMMARY,
229 IDS_PAGEINFO_SECURE_DETAILS); 229 IDS_PAGE_INFO_SECURE_DETAILS);
230 } 230 }
231 case PageInfo::SITE_IDENTITY_STATUS_MALWARE: 231 case PageInfo::SITE_IDENTITY_STATUS_MALWARE:
232 return CreateSecurityDescription(IDS_PAGEINFO_MALWARE_SUMMARY, 232 return CreateSecurityDescription(IDS_PAGE_INFO_MALWARE_SUMMARY,
233 IDS_PAGEINFO_MALWARE_DETAILS); 233 IDS_PAGE_INFO_MALWARE_DETAILS);
234 case PageInfo::SITE_IDENTITY_STATUS_SOCIAL_ENGINEERING: 234 case PageInfo::SITE_IDENTITY_STATUS_SOCIAL_ENGINEERING:
235 return CreateSecurityDescription(IDS_PAGEINFO_SOCIAL_ENGINEERING_SUMMARY, 235 return CreateSecurityDescription(
236 IDS_PAGEINFO_SOCIAL_ENGINEERING_DETAILS); 236 IDS_PAGE_INFO_SOCIAL_ENGINEERING_SUMMARY,
237 IDS_PAGE_INFO_SOCIAL_ENGINEERING_DETAILS);
237 case PageInfo::SITE_IDENTITY_STATUS_UNWANTED_SOFTWARE: 238 case PageInfo::SITE_IDENTITY_STATUS_UNWANTED_SOFTWARE:
238 return CreateSecurityDescription(IDS_PAGEINFO_UNWANTED_SOFTWARE_SUMMARY, 239 return CreateSecurityDescription(IDS_PAGE_INFO_UNWANTED_SOFTWARE_SUMMARY,
239 IDS_PAGEINFO_UNWANTED_SOFTWARE_DETAILS); 240 IDS_PAGE_INFO_UNWANTED_SOFTWARE_DETAILS);
240 case PageInfo::SITE_IDENTITY_STATUS_DEPRECATED_SIGNATURE_ALGORITHM: 241 case PageInfo::SITE_IDENTITY_STATUS_DEPRECATED_SIGNATURE_ALGORITHM:
241 case PageInfo::SITE_IDENTITY_STATUS_UNKNOWN: 242 case PageInfo::SITE_IDENTITY_STATUS_UNKNOWN:
242 case PageInfo::SITE_IDENTITY_STATUS_NO_CERT: 243 case PageInfo::SITE_IDENTITY_STATUS_NO_CERT:
243 default: 244 default:
244 return CreateSecurityDescription(IDS_PAGEINFO_NOT_SECURE_SUMMARY, 245 return CreateSecurityDescription(IDS_PAGE_INFO_NOT_SECURE_SUMMARY,
245 IDS_PAGEINFO_NOT_SECURE_DETAILS); 246 IDS_PAGE_INFO_NOT_SECURE_DETAILS);
246 } 247 }
247 } 248 }
248 249
249 PageInfoUI::~PageInfoUI() {} 250 PageInfoUI::~PageInfoUI() {}
250 251
251 // static 252 // static
252 base::string16 PageInfoUI::PermissionTypeToUIString(ContentSettingsType type) { 253 base::string16 PageInfoUI::PermissionTypeToUIString(ContentSettingsType type) {
253 for (const PermissionsUIInfo& info : kPermissionsUIInfo) { 254 for (const PermissionsUIInfo& info : kPermissionsUIInfo) {
254 if (info.type == type) 255 if (info.type == type)
255 return l10n_util::GetStringUTF16(info.string_id); 256 return l10n_util::GetStringUTF16(info.string_id);
256 } 257 }
257 NOTREACHED(); 258 NOTREACHED();
258 return base::string16(); 259 return base::string16();
259 } 260 }
260 261
261 // static 262 // static
262 base::string16 PageInfoUI::PermissionValueToUIString(ContentSetting value) {
263 switch (value) {
264 case CONTENT_SETTING_ALLOW:
265 return l10n_util::GetStringUTF16(IDS_PAGE_INFO_PERMISSION_ALLOW);
266 case CONTENT_SETTING_BLOCK:
267 return l10n_util::GetStringUTF16(IDS_PAGE_INFO_PERMISSION_BLOCK);
268 case CONTENT_SETTING_ASK:
269 return l10n_util::GetStringUTF16(IDS_PAGE_INFO_PERMISSION_ASK);
270 default:
271 NOTREACHED();
272 return base::string16();
273 }
274 }
275
276 // static
277 base::string16 PageInfoUI::PermissionActionToUIString( 263 base::string16 PageInfoUI::PermissionActionToUIString(
278 Profile* profile, 264 Profile* profile,
279 ContentSettingsType type, 265 ContentSettingsType type,
280 ContentSetting setting, 266 ContentSetting setting,
281 ContentSetting default_setting, 267 ContentSetting default_setting,
282 content_settings::SettingSource source) { 268 content_settings::SettingSource source) {
283 ContentSetting effective_setting = 269 ContentSetting effective_setting =
284 GetEffectiveSetting(profile, type, setting, default_setting); 270 GetEffectiveSetting(profile, type, setting, default_setting);
285 const int* button_text_ids = NULL; 271 const int* button_text_ids = NULL;
286 switch (source) { 272 switch (source) {
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
464 const gfx::ImageSkia PageInfoUI::GetCertificateIcon() { 450 const gfx::ImageSkia PageInfoUI::GetCertificateIcon() {
465 return gfx::CreateVectorIcon(kCertificateIcon, 16, gfx::kChromeIconGrey); 451 return gfx::CreateVectorIcon(kCertificateIcon, 16, gfx::kChromeIconGrey);
466 } 452 }
467 #endif 453 #endif
468 454
469 // static 455 // static
470 bool PageInfoUI::ShouldShowCertificateLink() { 456 bool PageInfoUI::ShouldShowCertificateLink() {
471 return base::CommandLine::ForCurrentProcess()->HasSwitch( 457 return base::CommandLine::ForCurrentProcess()->HasSwitch(
472 switches::kShowCertLink); 458 switches::kShowCertLink);
473 } 459 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/page_info/page_info_ui.h ('k') | chrome/browser/ui/page_info/permission_menu_model.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698