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

Side by Side 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: Created 5 years 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "chrome/browser/interstitials/chrome_controller_client.h"
6
7 #include "base/prefs/pref_service.h"
8 #include "chrome/browser/browser_process.h"
9 #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
10 #include "chrome/browser/profiles/profile.h"
11 #include "chrome/common/pref_names.h"
12 #include "content/public/browser/web_contents.h"
13
14 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.
15 using content::Referrer;
16
17 ChromeControllerClient::ChromeControllerClient(
18 content::WebContents* web_contents)
19 : web_contents_(web_contents) {}
20
21 ChromeControllerClient::~ChromeControllerClient() {}
22
23 void ChromeControllerClient::OpenUrlInCurrentTab(const GURL& url) {
24 OpenURLParams params(url, Referrer(), CURRENT_TAB, ui::PAGE_TRANSITION_LINK,
25 false);
26 web_contents_->OpenURL(params);
27 }
28
29 const std::string& ChromeControllerClient::GetApplicationLocale() {
30 return g_browser_process->GetApplicationLocale();
31 }
32
33 PrefService* ChromeControllerClient::GetPrefService() {
34 Profile* profile =
35 Profile::FromBrowserContext(web_contents_->GetBrowserContext());
36 return profile->GetPrefs();
37 }
38
39 const std::string ChromeControllerClient::GetExtendedReportingPrefName() {
40 return prefs::kSafeBrowsingExtendedReportingEnabled;
41 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698