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/profiles/profile.h" |
| 10 #include "chrome/common/pref_names.h" |
| 11 #include "content/public/browser/web_contents.h" |
| 12 #include "content/public/common/referrer.h" |
| 13 |
| 14 using content::Referrer; |
| 15 |
| 16 ChromeControllerClient::ChromeControllerClient( |
| 17 content::WebContents* web_contents) |
| 18 : web_contents_(web_contents) {} |
| 19 |
| 20 ChromeControllerClient::~ChromeControllerClient() {} |
| 21 |
| 22 void ChromeControllerClient::OpenUrlInCurrentTab(const GURL& url) { |
| 23 content::OpenURLParams params(url, Referrer(), CURRENT_TAB, |
| 24 ui::PAGE_TRANSITION_LINK, false); |
| 25 web_contents_->OpenURL(params); |
| 26 } |
| 27 |
| 28 const std::string& ChromeControllerClient::GetApplicationLocale() { |
| 29 return g_browser_process->GetApplicationLocale(); |
| 30 } |
| 31 |
| 32 PrefService* ChromeControllerClient::GetPrefService() { |
| 33 Profile* profile = |
| 34 Profile::FromBrowserContext(web_contents_->GetBrowserContext()); |
| 35 return profile->GetPrefs(); |
| 36 } |
| 37 |
| 38 const std::string ChromeControllerClient::GetExtendedReportingPrefName() { |
| 39 return prefs::kSafeBrowsingExtendedReportingEnabled; |
| 40 } |
OLD | NEW |