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

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

Issue 2603433002: Move SecurityInterstitialPage into component (Closed)
Patch Set: nit, refind comments Created 4 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 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
index a268d65e1cd1d45c583c5f937dfe33d917c2bb64..2283bc6a03d4bf7487f4bf4b3115cea2b17fac93 100644
--- a/chrome/browser/interstitials/chrome_controller_client.cc
+++ b/chrome/browser/interstitials/chrome_controller_client.cc
@@ -14,12 +14,9 @@
#include "chrome/browser/profiles/profile.h"
#include "chrome/common/pref_names.h"
#include "chrome/common/url_constants.h"
-#include "components/prefs/pref_service.h"
#include "components/safe_browsing_db/safe_browsing_prefs.h"
#include "content/public/browser/browser_thread.h"
-#include "content/public/browser/interstitial_page.h"
#include "content/public/browser/web_contents.h"
-#include "content/public/common/referrer.h"
#if defined(OS_ANDROID)
#include "chrome/browser/android/intent_helper.h"
@@ -123,17 +120,13 @@ void LaunchDateAndTimeSettingsOnFileThread() {
ChromeControllerClient::ChromeControllerClient(
content::WebContents* web_contents,
std::unique_ptr<security_interstitials::MetricsHelper> metrics_helper)
- : ControllerClient(std::move(metrics_helper)),
- web_contents_(web_contents),
- interstitial_page_(nullptr) {}
+ : SecurityInterstitialControllerClient(
+ web_contents,
+ std::move(metrics_helper),
+ GURL(chrome::kChromeUINewTabURL)) {}
ChromeControllerClient::~ChromeControllerClient() {}
-void ChromeControllerClient::set_interstitial_page(
- content::InterstitialPage* interstitial_page) {
- interstitial_page_ = interstitial_page;
-}
-
bool ChromeControllerClient::CanLaunchDateAndTimeSettings() {
#if defined(OS_ANDROID) || defined(OS_CHROMEOS) || defined(OS_LINUX) || \
defined(OS_MACOSX) || defined(OS_WIN)
@@ -156,38 +149,6 @@ void ChromeControllerClient::LaunchDateAndTimeSettings() {
#endif
}
-void ChromeControllerClient::GoBack() {
- interstitial_page_->DontProceed();
-}
-
-// If the offending entry has committed, go back or to a safe page without
-// closing the error page. This error page will be closed when the new page
-// commits.
-void ChromeControllerClient::GoBackAfterNavigationCommitted() {
- if (web_contents_->GetController().CanGoBack()) {
- web_contents_->GetController().GoBack();
- } else {
- web_contents_->GetController().LoadURL(
- GURL(chrome::kChromeUINewTabURL), content::Referrer(),
- ui::PAGE_TRANSITION_AUTO_TOPLEVEL, std::string());
- }
-}
-
-void ChromeControllerClient::Proceed() {
- interstitial_page_->Proceed();
-}
-
-void ChromeControllerClient::Reload() {
- web_contents_->GetController().Reload(content::ReloadType::NORMAL, true);
-}
-
-void ChromeControllerClient::OpenUrlInCurrentTab(const GURL& url) {
- content::OpenURLParams params(url, Referrer(),
- WindowOpenDisposition::CURRENT_TAB,
- ui::PAGE_TRANSITION_LINK, false);
- web_contents_->OpenURL(params);
-}
-
const std::string& ChromeControllerClient::GetApplicationLocale() {
return g_browser_process->GetApplicationLocale();
}
@@ -197,7 +158,3 @@ PrefService* ChromeControllerClient::GetPrefService() {
Profile::FromBrowserContext(web_contents_->GetBrowserContext());
return profile->GetPrefs();
meacer 2016/12/27 23:22:34 Seems like you can get rid of these two overrides
Jialiu Lin 2016/12/28 18:30:00 Yes, that's right. Done.
}
-
-const std::string ChromeControllerClient::GetExtendedReportingPrefName() {
- return safe_browsing::GetExtendedReportingPrefName(*GetPrefService());
-}

Powered by Google App Engine
This is Rietveld 408576698