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

Side by Side Diff: chrome/browser/ui/page_info/page_info.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.h" 5 #include "chrome/browser/ui/page_info/page_info.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <string> 10 #include <string>
(...skipping 27 matching lines...) Expand all
38 #include "chrome/browser/permissions/permission_uma_util.h" 38 #include "chrome/browser/permissions/permission_uma_util.h"
39 #include "chrome/browser/permissions/permission_util.h" 39 #include "chrome/browser/permissions/permission_util.h"
40 #include "chrome/browser/profiles/profile.h" 40 #include "chrome/browser/profiles/profile.h"
41 #include "chrome/browser/ssl/chrome_ssl_host_state_delegate.h" 41 #include "chrome/browser/ssl/chrome_ssl_host_state_delegate.h"
42 #include "chrome/browser/ssl/chrome_ssl_host_state_delegate_factory.h" 42 #include "chrome/browser/ssl/chrome_ssl_host_state_delegate_factory.h"
43 #include "chrome/browser/ui/page_info/page_info_ui.h" 43 #include "chrome/browser/ui/page_info/page_info_ui.h"
44 #include "chrome/browser/usb/usb_chooser_context.h" 44 #include "chrome/browser/usb/usb_chooser_context.h"
45 #include "chrome/browser/usb/usb_chooser_context_factory.h" 45 #include "chrome/browser/usb/usb_chooser_context_factory.h"
46 #include "chrome/common/chrome_switches.h" 46 #include "chrome/common/chrome_switches.h"
47 #include "chrome/common/url_constants.h" 47 #include "chrome/common/url_constants.h"
48 #include "chrome/grit/chromium_strings.h"
49 #include "chrome/grit/generated_resources.h"
50 #include "chrome/grit/theme_resources.h" 48 #include "chrome/grit/theme_resources.h"
51 #include "components/content_settings/core/browser/content_settings_utils.h" 49 #include "components/content_settings/core/browser/content_settings_utils.h"
52 #include "components/content_settings/core/browser/host_content_settings_map.h" 50 #include "components/content_settings/core/browser/host_content_settings_map.h"
53 #include "components/content_settings/core/common/content_settings.h" 51 #include "components/content_settings/core/common/content_settings.h"
54 #include "components/content_settings/core/common/content_settings_pattern.h" 52 #include "components/content_settings/core/common/content_settings_pattern.h"
55 #include "components/rappor/public/rappor_utils.h" 53 #include "components/rappor/public/rappor_utils.h"
56 #include "components/rappor/rappor_service_impl.h" 54 #include "components/rappor/rappor_service_impl.h"
57 #include "components/ssl_errors/error_info.h" 55 #include "components/ssl_errors/error_info.h"
58 #include "components/strings/grit/components_chromium_strings.h" 56 #include "components/strings/grit/components_chromium_strings.h"
59 #include "components/strings/grit/components_strings.h" 57 #include "components/strings/grit/components_strings.h"
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 void GetSiteIdentityByMaliciousContentStatus( 200 void GetSiteIdentityByMaliciousContentStatus(
203 security_state::MaliciousContentStatus malicious_content_status, 201 security_state::MaliciousContentStatus malicious_content_status,
204 PageInfo::SiteIdentityStatus* status, 202 PageInfo::SiteIdentityStatus* status,
205 base::string16* details) { 203 base::string16* details) {
206 switch (malicious_content_status) { 204 switch (malicious_content_status) {
207 case security_state::MALICIOUS_CONTENT_STATUS_NONE: 205 case security_state::MALICIOUS_CONTENT_STATUS_NONE:
208 NOTREACHED(); 206 NOTREACHED();
209 break; 207 break;
210 case security_state::MALICIOUS_CONTENT_STATUS_MALWARE: 208 case security_state::MALICIOUS_CONTENT_STATUS_MALWARE:
211 *status = PageInfo::SITE_IDENTITY_STATUS_MALWARE; 209 *status = PageInfo::SITE_IDENTITY_STATUS_MALWARE;
212 *details = l10n_util::GetStringUTF16(IDS_PAGEINFO_MALWARE_DETAILS); 210 *details = l10n_util::GetStringUTF16(IDS_PAGE_INFO_MALWARE_DETAILS);
213 break; 211 break;
214 case security_state::MALICIOUS_CONTENT_STATUS_SOCIAL_ENGINEERING: 212 case security_state::MALICIOUS_CONTENT_STATUS_SOCIAL_ENGINEERING:
215 *status = PageInfo::SITE_IDENTITY_STATUS_SOCIAL_ENGINEERING; 213 *status = PageInfo::SITE_IDENTITY_STATUS_SOCIAL_ENGINEERING;
216 *details = 214 *details =
217 l10n_util::GetStringUTF16(IDS_PAGEINFO_SOCIAL_ENGINEERING_DETAILS); 215 l10n_util::GetStringUTF16(IDS_PAGE_INFO_SOCIAL_ENGINEERING_DETAILS);
218 break; 216 break;
219 case security_state::MALICIOUS_CONTENT_STATUS_UNWANTED_SOFTWARE: 217 case security_state::MALICIOUS_CONTENT_STATUS_UNWANTED_SOFTWARE:
220 *status = PageInfo::SITE_IDENTITY_STATUS_UNWANTED_SOFTWARE; 218 *status = PageInfo::SITE_IDENTITY_STATUS_UNWANTED_SOFTWARE;
221 *details = 219 *details =
222 l10n_util::GetStringUTF16(IDS_PAGEINFO_UNWANTED_SOFTWARE_DETAILS); 220 l10n_util::GetStringUTF16(IDS_PAGE_INFO_UNWANTED_SOFTWARE_DETAILS);
223 break; 221 break;
224 } 222 }
225 } 223 }
226 224
227 base::string16 GetSimpleSiteName(const GURL& url) { 225 base::string16 GetSimpleSiteName(const GURL& url) {
228 return url_formatter::FormatUrlForSecurityDisplay( 226 return url_formatter::FormatUrlForSecurityDisplay(
229 url, url_formatter::SchemeDisplay::OMIT_HTTP_AND_HTTPS); 227 url, url_formatter::SchemeDisplay::OMIT_HTTP_AND_HTTPS);
230 } 228 }
231 229
232 ChooserContextBase* GetUsbChooserContext(Profile* profile) { 230 ChooserContextBase* GetUsbChooserContext(Profile* profile) {
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after
492 DCHECK(!certificate_->subject().organization_names.empty()); 490 DCHECK(!certificate_->subject().organization_names.empty());
493 organization_name_ = 491 organization_name_ =
494 UTF8ToUTF16(certificate_->subject().organization_names[0]); 492 UTF8ToUTF16(certificate_->subject().organization_names[0]);
495 // An EV Cert is required to have a city (localityName) and country but 493 // An EV Cert is required to have a city (localityName) and country but
496 // state is "if any". 494 // state is "if any".
497 DCHECK(!certificate_->subject().locality_name.empty()); 495 DCHECK(!certificate_->subject().locality_name.empty());
498 DCHECK(!certificate_->subject().country_name.empty()); 496 DCHECK(!certificate_->subject().country_name.empty());
499 base::string16 locality; 497 base::string16 locality;
500 if (!certificate_->subject().state_or_province_name.empty()) { 498 if (!certificate_->subject().state_or_province_name.empty()) {
501 locality = l10n_util::GetStringFUTF16( 499 locality = l10n_util::GetStringFUTF16(
502 IDS_PAGEINFO_ADDRESS, 500 IDS_PAGE_INFO_ADDRESS,
503 UTF8ToUTF16(certificate_->subject().locality_name), 501 UTF8ToUTF16(certificate_->subject().locality_name),
504 UTF8ToUTF16(certificate_->subject().state_or_province_name), 502 UTF8ToUTF16(certificate_->subject().state_or_province_name),
505 UTF8ToUTF16(certificate_->subject().country_name)); 503 UTF8ToUTF16(certificate_->subject().country_name));
506 } else { 504 } else {
507 locality = l10n_util::GetStringFUTF16( 505 locality = l10n_util::GetStringFUTF16(
508 IDS_PAGEINFO_PARTIAL_ADDRESS, 506 IDS_PAGE_INFO_PARTIAL_ADDRESS,
509 UTF8ToUTF16(certificate_->subject().locality_name), 507 UTF8ToUTF16(certificate_->subject().locality_name),
510 UTF8ToUTF16(certificate_->subject().country_name)); 508 UTF8ToUTF16(certificate_->subject().country_name));
511 } 509 }
512 DCHECK(!certificate_->subject().organization_names.empty()); 510 DCHECK(!certificate_->subject().organization_names.empty());
513 site_identity_details_.assign(l10n_util::GetStringFUTF16( 511 site_identity_details_.assign(l10n_util::GetStringFUTF16(
514 IDS_PAGE_INFO_SECURITY_TAB_SECURE_IDENTITY_EV_VERIFIED, 512 IDS_PAGE_INFO_SECURITY_TAB_SECURE_IDENTITY_EV_VERIFIED,
515 UTF8ToUTF16(certificate_->subject().organization_names[0]), 513 UTF8ToUTF16(certificate_->subject().organization_names[0]),
516 locality, UTF8ToUTF16(certificate_->issuer().GetDisplayName()))); 514 locality, UTF8ToUTF16(certificate_->issuer().GetDisplayName())));
517 } else { 515 } else {
518 // Non-EV OK HTTPS page. 516 // Non-EV OK HTTPS page.
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after
769 info.site_identity = UTF16ToUTF8(GetSimpleSiteName(site_url_)); 767 info.site_identity = UTF16ToUTF8(GetSimpleSiteName(site_url_));
770 768
771 info.connection_status = site_connection_status_; 769 info.connection_status = site_connection_status_;
772 info.connection_status_description = UTF16ToUTF8(site_connection_details_); 770 info.connection_status_description = UTF16ToUTF8(site_connection_details_);
773 info.identity_status = site_identity_status_; 771 info.identity_status = site_identity_status_;
774 info.identity_status_description = UTF16ToUTF8(site_identity_details_); 772 info.identity_status_description = UTF16ToUTF8(site_identity_details_);
775 info.certificate = certificate_; 773 info.certificate = certificate_;
776 info.show_ssl_decision_revoke_button = show_ssl_decision_revoke_button_; 774 info.show_ssl_decision_revoke_button = show_ssl_decision_revoke_button_;
777 ui_->SetIdentityInfo(info); 775 ui_->SetIdentityInfo(info);
778 } 776 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/login/login_handler_unittest.cc ('k') | chrome/browser/ui/page_info/page_info_infobar_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698