OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 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 #ifndef COMPONENTS_SECURITY_INTERSTITIALS_CONTENT_SECURITY_INTERSTITIAL_CONTROLL
ER_CLIENT_H_ |
| 6 #define COMPONENTS_SECURITY_INTERSTITIALS_CONTENT_SECURITY_INTERSTITIAL_CONTROLL
ER_CLIENT_H_ |
| 7 |
| 8 #include "base/macros.h" |
| 9 #include "components/security_interstitials/core/controller_client.h" |
| 10 #include "url/gurl.h" |
| 11 |
| 12 namespace content { |
| 13 class InterstitialPage; |
| 14 class WebContents; |
| 15 } |
| 16 |
| 17 namespace security_interstitials { |
| 18 |
| 19 class MetricsHelper; |
| 20 |
| 21 // Handle commands from security interstitial pages. This class is instantiated |
| 22 // by SafeBrowsingBlockingPage. |
| 23 class SecurityInterstitialControllerClient |
| 24 : public security_interstitials::ControllerClient { |
| 25 public: |
| 26 SecurityInterstitialControllerClient( |
| 27 content::WebContents* web_contents, |
| 28 std::unique_ptr<MetricsHelper> metrics_helper, |
| 29 PrefService* prefs, |
| 30 const std::string& app_locale, |
| 31 const GURL& default_safe_page); |
| 32 |
| 33 ~SecurityInterstitialControllerClient() override; |
| 34 |
| 35 void set_interstitial_page(content::InterstitialPage* interstitial_page); |
| 36 content::InterstitialPage* interstitial_page(); |
| 37 |
| 38 // security_interstitials::ControllerClient overrides. |
| 39 void GoBack() override; |
| 40 void GoBackAfterNavigationCommitted() override; |
| 41 void Proceed() override; |
| 42 void Reload() override; |
| 43 void OpenUrlInCurrentTab(const GURL& url) override; |
| 44 PrefService* GetPrefService() const override; |
| 45 const std::string& GetApplicationLocale() const override; |
| 46 bool CanLaunchDateAndTimeSettings() override; |
| 47 void LaunchDateAndTimeSettings() override; |
| 48 |
| 49 protected: |
| 50 // security_interstitials::ControllerClient overrides. |
| 51 const std::string GetExtendedReportingPrefName() const override; |
| 52 content::WebContents* web_contents_; |
| 53 |
| 54 private: |
| 55 content::InterstitialPage* interstitial_page_; |
| 56 PrefService* prefs_; |
| 57 const std::string app_locale_; |
| 58 // The default safe page we should go to if there is no previous page to go |
| 59 // back to, e.g. chrome:kChromeUINewTabURL. |
| 60 const GURL default_safe_page_; |
| 61 |
| 62 DISALLOW_COPY_AND_ASSIGN(SecurityInterstitialControllerClient); |
| 63 }; |
| 64 |
| 65 } // namespace security_interstitials |
| 66 |
| 67 #endif // COMPONENTS_SECURITY_INTERSTITIALS_CONTENT_SECURITY_INTERSTITIAL_CONTR
OLLER_CLIENT_H_ |
OLD | NEW |