Index: chrome/browser/interstitials/chrome_controller_client.cc |
diff --git a/chrome/browser/interstitials/chrome_controller_client.cc b/chrome/browser/interstitials/chrome_controller_client.cc |
new file mode 100644 |
index 0000000000000000000000000000000000000000..909daee63295bd3de6e78c7879eea9770669e8ec |
--- /dev/null |
+++ b/chrome/browser/interstitials/chrome_controller_client.cc |
@@ -0,0 +1,41 @@ |
+// Copyright 2015 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#include "chrome/browser/interstitials/chrome_controller_client.h" |
+ |
+#include "base/prefs/pref_service.h" |
+#include "chrome/browser/browser_process.h" |
+#include "chrome/browser/net/referrer.h" |
estark
2015/11/23 16:25:23
Are you using this? Is it by chance supposed to be
felt
2015/11/24 00:18:11
ah yes! i'd just blindly copied it from the old fi
|
+#include "chrome/browser/profiles/profile.h" |
+#include "chrome/common/pref_names.h" |
+#include "content/public/browser/web_contents.h" |
+ |
+using content::OpenURLParams; |
estark
2015/11/23 16:25:23
optional nit: I've been told to only use `using` w
felt
2015/11/24 00:18:11
Done.
|
+using content::Referrer; |
+ |
+ChromeControllerClient::ChromeControllerClient( |
+ content::WebContents* web_contents) |
+ : web_contents_(web_contents) {} |
+ |
+ChromeControllerClient::~ChromeControllerClient() {} |
+ |
+void ChromeControllerClient::OpenUrlInCurrentTab(const GURL& url) { |
+ OpenURLParams params(url, Referrer(), CURRENT_TAB, ui::PAGE_TRANSITION_LINK, |
+ false); |
+ web_contents_->OpenURL(params); |
+} |
+ |
+const std::string& ChromeControllerClient::GetApplicationLocale() { |
+ return g_browser_process->GetApplicationLocale(); |
+} |
+ |
+PrefService* ChromeControllerClient::GetPrefService() { |
+ Profile* profile = |
+ Profile::FromBrowserContext(web_contents_->GetBrowserContext()); |
+ return profile->GetPrefs(); |
+} |
+ |
+const std::string ChromeControllerClient::GetExtendedReportingPrefName() { |
+ return prefs::kSafeBrowsingExtendedReportingEnabled; |
+} |