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

Side by Side Diff: components/security_interstitials/content/security_interstitial_controller_client.h

Issue 2603433002: Move SecurityInterstitialPage into component (Closed)
Patch Set: missed some changes in rebase Created 3 years, 11 months 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 unified diff | Download patch
OLDNEW
(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 should only be
22 // instantiated by SafeBrowsingBlockingPage for the time being.
23 // TODO(jialiul): After we've done componentizing SafeBrowsingBlockingPage, we
24 // should revisit this class to decide if other interstitials can use
25 // SecurityInterstitialControllerClient.
26 class SecurityInterstitialControllerClient
27 : public security_interstitials::ControllerClient {
28 public:
29 SecurityInterstitialControllerClient(
30 content::WebContents* web_contents,
31 std::unique_ptr<MetricsHelper> metrics_helper,
32 PrefService* prefs,
33 const std::string& app_locale,
34 const GURL& default_safe_page);
35
36 ~SecurityInterstitialControllerClient() override;
37
38 void set_interstitial_page(content::InterstitialPage* interstitial_page);
39 content::InterstitialPage* interstitial_page();
40
41 // security_interstitials::ControllerClient overrides.
42 void GoBack() override;
43 void GoBackAfterNavigationCommitted() override;
44 void Proceed() override;
45 void Reload() override;
46 void OpenUrlInCurrentTab(const GURL& url) override;
47 PrefService* GetPrefService() override;
48 const std::string& GetApplicationLocale() const override;
49 bool CanLaunchDateAndTimeSettings() override;
50 void LaunchDateAndTimeSettings() override;
51
52 protected:
53 // security_interstitials::ControllerClient overrides.
54 const std::string GetExtendedReportingPrefName() const override;
55 content::WebContents* web_contents_;
56
57 private:
58 content::InterstitialPage* interstitial_page_;
59 PrefService* prefs_;
60 const std::string app_locale_;
61 // The default safe page we should go to if there is no previous page to go
62 // back to, e.g. chrome:kChromeUINewTabURL.
63 const GURL default_safe_page_;
64
65 DISALLOW_COPY_AND_ASSIGN(SecurityInterstitialControllerClient);
66 };
67
68 } // namespace security_interstitials
69
70 #endif // COMPONENTS_SECURITY_INTERSTITIALS_CONTENT_SECURITY_INTERSTITIAL_CONTR OLLER_CLIENT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698