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

Side by Side Diff: chrome/browser/interstitials/security_interstitial_page.cc

Issue 1841653003: Drop |languages| from {Format,Elide}Url* and IDNToUnicode (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix typo in elide_url.cc Created 4 years, 8 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) 2014 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2014 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/interstitials/security_interstitial_page.h" 5 #include "chrome/browser/interstitials/security_interstitial_page.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/i18n/rtl.h" 9 #include "base/i18n/rtl.h"
10 #include "base/metrics/histogram.h" 10 #include "base/metrics/histogram.h"
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 AfterShow(); 71 AfterShow();
72 } 72 }
73 73
74 bool SecurityInterstitialPage::IsPrefEnabled(const char* pref) { 74 bool SecurityInterstitialPage::IsPrefEnabled(const char* pref) {
75 Profile* profile = 75 Profile* profile =
76 Profile::FromBrowserContext(web_contents()->GetBrowserContext()); 76 Profile::FromBrowserContext(web_contents()->GetBrowserContext());
77 return profile->GetPrefs()->GetBoolean(pref); 77 return profile->GetPrefs()->GetBoolean(pref);
78 } 78 }
79 79
80 base::string16 SecurityInterstitialPage::GetFormattedHostName() const { 80 base::string16 SecurityInterstitialPage::GetFormattedHostName() const {
81 std::string languages;
82 Profile* profile =
83 Profile::FromBrowserContext(web_contents()->GetBrowserContext());
84 if (profile)
85 languages = profile->GetPrefs()->GetString(prefs::kAcceptLanguages);
86 return security_interstitials::common_string_util::GetFormattedHostName( 81 return security_interstitials::common_string_util::GetFormattedHostName(
87 request_url_, languages); 82 request_url_);
88 } 83 }
89 84
90 std::string SecurityInterstitialPage::GetHTMLContents() { 85 std::string SecurityInterstitialPage::GetHTMLContents() {
91 base::DictionaryValue load_time_data; 86 base::DictionaryValue load_time_data;
92 PopulateInterstitialStrings(&load_time_data); 87 PopulateInterstitialStrings(&load_time_data);
93 const std::string& app_locale = g_browser_process->GetApplicationLocale(); 88 const std::string& app_locale = g_browser_process->GetApplicationLocale();
94 webui::SetLoadTimeDataDefaults(app_locale, &load_time_data); 89 webui::SetLoadTimeDataDefaults(app_locale, &load_time_data);
95 std::string html = ResourceBundle::GetSharedInstance() 90 std::string html = ResourceBundle::GetSharedInstance()
96 .GetRawDataResource(IDR_SECURITY_INTERSTITIAL_HTML) 91 .GetRawDataResource(IDR_SECURITY_INTERSTITIAL_HTML)
97 .as_string(); 92 .as_string();
(...skipping 11 matching lines...) Expand all
109 104
110 security_interstitials::MetricsHelper* 105 security_interstitials::MetricsHelper*
111 SecurityInterstitialPage::metrics_helper() { 106 SecurityInterstitialPage::metrics_helper() {
112 return controller_->metrics_helper(); 107 return controller_->metrics_helper();
113 } 108 }
114 109
115 void SecurityInterstitialPage::set_metrics_helper( 110 void SecurityInterstitialPage::set_metrics_helper(
116 std::unique_ptr<security_interstitials::MetricsHelper> metrics_helper) { 111 std::unique_ptr<security_interstitials::MetricsHelper> metrics_helper) {
117 controller_->set_metrics_helper(std::move(metrics_helper)); 112 controller_->set_metrics_helper(std::move(metrics_helper));
118 } 113 }
OLDNEW
« no previous file with comments | « chrome/browser/history/history_tab_helper.cc ('k') | chrome/browser/media/media_stream_capture_indicator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698