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

Unified Diff: chrome/browser/interstitials/chrome_controller_client.cc

Issue 1467063002: Introduce the ChromeControllerClient class (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Bugfix Created 5 years, 1 month 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 side-by-side diff with in-line comments
Download patch
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..01c1be72a86d3e965b9ec9ff26b8a847c440de42
--- /dev/null
+++ b/chrome/browser/interstitials/chrome_controller_client.cc
@@ -0,0 +1,40 @@
+// 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/profiles/profile.h"
+#include "chrome/common/pref_names.h"
+#include "content/public/browser/web_contents.h"
+#include "content/public/common/referrer.h"
+
+using content::Referrer;
+
+ChromeControllerClient::ChromeControllerClient(
+ content::WebContents* web_contents)
+ : web_contents_(web_contents) {}
+
+ChromeControllerClient::~ChromeControllerClient() {}
+
+void ChromeControllerClient::OpenUrlInCurrentTab(const GURL& url) {
+ content::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;
+}
« no previous file with comments | « chrome/browser/interstitials/chrome_controller_client.h ('k') | chrome/browser/interstitials/security_interstitial_page.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698