1 // Copyright 2019 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 "components/safe_browsing/content/safe_browsing_controller_client.h"
6 
7 #include "base/feature_list.h"
8 #include "components/safe_browsing/core/features.h"
9 #include "components/security_interstitials/content/settings_page_helper.h"
10 #include "components/security_interstitials/core/metrics_helper.h"
11 
12 namespace safe_browsing {
13 
SafeBrowsingControllerClient(content::WebContents * web_contents,std::unique_ptr<security_interstitials::MetricsHelper> metrics_helper,PrefService * prefs,const std::string & app_locale,const GURL & default_safe_page,std::unique_ptr<security_interstitials::SettingsPageHelper> settings_page_helper)14 SafeBrowsingControllerClient::SafeBrowsingControllerClient(
15     content::WebContents* web_contents,
16     std::unique_ptr<security_interstitials::MetricsHelper> metrics_helper,
17     PrefService* prefs,
18     const std::string& app_locale,
19     const GURL& default_safe_page,
20     std::unique_ptr<security_interstitials::SettingsPageHelper>
21         settings_page_helper)
22     : security_interstitials::SecurityInterstitialControllerClient(
23           web_contents,
24           std::move(metrics_helper),
25           prefs,
26           app_locale,
27           default_safe_page,
28           std::move(settings_page_helper)) {}
29 
~SafeBrowsingControllerClient()30 SafeBrowsingControllerClient::~SafeBrowsingControllerClient() {}
31 
Proceed()32 void SafeBrowsingControllerClient::Proceed() {
33   // With committed interstitials the site has already
34   // been added to the whitelist, so reload will proceed.
35   Reload();
36   return;
37 }
38 
GoBack()39 void SafeBrowsingControllerClient::GoBack() {
40   SecurityInterstitialControllerClient::GoBackAfterNavigationCommitted();
41   return;
42 }
43 
44 }  // namespace safe_browsing
45