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

Side by Side Diff: components/security_interstitials/core/common_string_util.cc

Issue 2158113002: Update interstitials to match the new security indicators (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Windows test fix Created 4 years, 5 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "components/security_interstitials/core/common_string_util.h" 5 #include "components/security_interstitials/core/common_string_util.h"
6 6
7 #include "base/feature_list.h"
7 #include "base/i18n/rtl.h" 8 #include "base/i18n/rtl.h"
8 #include "base/i18n/time_formatting.h" 9 #include "base/i18n/time_formatting.h"
9 #include "base/strings/string_util.h" 10 #include "base/strings/string_util.h"
10 #include "components/url_formatter/url_formatter.h" 11 #include "components/url_formatter/url_formatter.h"
11 #include "grit/components_strings.h" 12 #include "grit/components_strings.h"
12 #include "net/base/net_errors.h" 13 #include "net/base/net_errors.h"
13 #include "ui/base/l10n/l10n_util.h" 14 #include "ui/base/l10n/l10n_util.h"
14 15
16 namespace {
17 const base::Feature kSecurityWarningIconUpdate{
18 "SecurityWarningIconUpdate", base::FEATURE_DISABLED_BY_DEFAULT};
19 } // namespace
20
15 namespace security_interstitials { 21 namespace security_interstitials {
16 22
17 namespace common_string_util { 23 namespace common_string_util {
18 24
19 base::string16 GetFormattedHostName(const GURL& gurl) { 25 base::string16 GetFormattedHostName(const GURL& gurl) {
20 base::string16 host = url_formatter::IDNToUnicode(gurl.host()); 26 base::string16 host = url_formatter::IDNToUnicode(gurl.host());
21 if (base::i18n::IsRTL()) 27 if (base::i18n::IsRTL())
22 base::i18n::WrapStringWithLTRFormatting(&host); 28 base::i18n::WrapStringWithLTRFormatting(&host);
23 return host; 29 return host;
24 } 30 }
(...skipping 18 matching lines...) Expand all
43 "expirationDate", 49 "expirationDate",
44 base::TimeFormatShortDate(ssl_info.cert->valid_expiry())); 50 base::TimeFormatShortDate(ssl_info.cert->valid_expiry()));
45 load_time_data->SetString("currentDate", 51 load_time_data->SetString("currentDate",
46 base::TimeFormatShortDate(time_triggered)); 52 base::TimeFormatShortDate(time_triggered));
47 std::vector<std::string> encoded_chain; 53 std::vector<std::string> encoded_chain;
48 ssl_info.cert->GetPEMEncodedChain(&encoded_chain); 54 ssl_info.cert->GetPEMEncodedChain(&encoded_chain);
49 load_time_data->SetString( 55 load_time_data->SetString(
50 "pem", base::JoinString(encoded_chain, base::StringPiece())); 56 "pem", base::JoinString(encoded_chain, base::StringPiece()));
51 } 57 }
52 58
59 void PopulateNewIconStrings(base::DictionaryValue* load_time_data) {
60 load_time_data->SetBoolean(
61 "iconUpdate", base::FeatureList::IsEnabled(kSecurityWarningIconUpdate));
62 }
63
53 } // namespace common_string_util 64 } // namespace common_string_util
54 65
55 } // namespace security_interstitials 66 } // namespace security_interstitials
OLDNEW
« no previous file with comments | « components/security_interstitials/core/common_string_util.h ('k') | components/security_interstitials/core/ssl_error_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698