Chromium Code Reviews| OLD | NEW |
|---|---|
| (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 } | |
| OLD | NEW |