OLD | NEW |
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 "chrome/browser/interstitials/chrome_controller_client.h" | 5 #include "chrome/browser/interstitials/chrome_controller_client.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/files/file_util.h" | 9 #include "base/files/file_util.h" |
10 #include "base/process/launch.h" | 10 #include "base/process/launch.h" |
11 #include "build/build_config.h" | 11 #include "build/build_config.h" |
12 #include "chrome/browser/browser_process.h" | 12 #include "chrome/browser/browser_process.h" |
| 13 #include "chrome/browser/interstitials/chrome_metrics_helper.h" |
13 #include "chrome/browser/profiles/profile.h" | 14 #include "chrome/browser/profiles/profile.h" |
14 #include "chrome/common/pref_names.h" | 15 #include "chrome/common/pref_names.h" |
15 #include "components/prefs/pref_service.h" | 16 #include "components/prefs/pref_service.h" |
16 #include "content/public/browser/browser_thread.h" | 17 #include "content/public/browser/browser_thread.h" |
17 #include "content/public/browser/interstitial_page.h" | 18 #include "content/public/browser/interstitial_page.h" |
18 #include "content/public/browser/web_contents.h" | 19 #include "content/public/browser/web_contents.h" |
19 #include "content/public/common/referrer.h" | 20 #include "content/public/common/referrer.h" |
20 | 21 |
21 #if defined(OS_ANDROID) | 22 #if defined(OS_ANDROID) |
22 #include "chrome/browser/android/intent_helper.h" | 23 #include "chrome/browser/android/intent_helper.h" |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 #else | 120 #else |
120 NOTREACHED(); | 121 NOTREACHED(); |
121 | 122 |
122 #endif | 123 #endif |
123 // Don't add code here! (See the comment at the beginning of the function.) | 124 // Don't add code here! (See the comment at the beginning of the function.) |
124 } | 125 } |
125 | 126 |
126 } // namespace | 127 } // namespace |
127 | 128 |
128 ChromeControllerClient::ChromeControllerClient( | 129 ChromeControllerClient::ChromeControllerClient( |
129 content::WebContents* web_contents) | 130 content::WebContents* web_contents, |
130 : web_contents_(web_contents), interstitial_page_(nullptr) {} | 131 std::unique_ptr<security_interstitials::MetricsHelper> metrics_helper) |
| 132 : ControllerClient(std::move(metrics_helper)), |
| 133 web_contents_(web_contents), |
| 134 interstitial_page_(nullptr) {} |
131 | 135 |
132 ChromeControllerClient::~ChromeControllerClient() {} | 136 ChromeControllerClient::~ChromeControllerClient() {} |
133 | 137 |
134 void ChromeControllerClient::set_interstitial_page( | 138 void ChromeControllerClient::set_interstitial_page( |
135 content::InterstitialPage* interstitial_page) { | 139 content::InterstitialPage* interstitial_page) { |
136 interstitial_page_ = interstitial_page; | 140 interstitial_page_ = interstitial_page; |
137 } | 141 } |
138 | 142 |
139 bool ChromeControllerClient::CanLaunchDateAndTimeSettings() { | 143 bool ChromeControllerClient::CanLaunchDateAndTimeSettings() { |
140 #if defined(OS_ANDROID) || defined(OS_CHROMEOS) || defined(OS_LINUX) || \ | 144 #if defined(OS_ANDROID) || defined(OS_CHROMEOS) || defined(OS_LINUX) || \ |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 | 179 |
176 PrefService* ChromeControllerClient::GetPrefService() { | 180 PrefService* ChromeControllerClient::GetPrefService() { |
177 Profile* profile = | 181 Profile* profile = |
178 Profile::FromBrowserContext(web_contents_->GetBrowserContext()); | 182 Profile::FromBrowserContext(web_contents_->GetBrowserContext()); |
179 return profile->GetPrefs(); | 183 return profile->GetPrefs(); |
180 } | 184 } |
181 | 185 |
182 const std::string ChromeControllerClient::GetExtendedReportingPrefName() { | 186 const std::string ChromeControllerClient::GetExtendedReportingPrefName() { |
183 return prefs::kSafeBrowsingExtendedReportingEnabled; | 187 return prefs::kSafeBrowsingExtendedReportingEnabled; |
184 } | 188 } |
OLD | NEW |