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

Side by Side Diff: components/security_interstitials/core/controller_client.h

Issue 2303413002: Simplify security_interstitials::ControllerClient and other related classes (Closed)
Patch Set: namespaces Created 4 years, 3 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
1 // Copyright 2015 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef COMPONENTS_SECURITY_INTERSTITIALS_CORE_CONTROLLER_CLIENT_H_ 5 #ifndef COMPONENTS_SECURITY_INTERSTITIALS_CORE_CONTROLLER_CLIENT_H_
6 #define COMPONENTS_SECURITY_INTERSTITIALS_CORE_CONTROLLER_CLIENT_H_ 6 #define COMPONENTS_SECURITY_INTERSTITIALS_CORE_CONTROLLER_CLIENT_H_
7 7
8 #include <memory> 8 #include <memory>
9 #include <string> 9 #include <string>
10 10
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 CMD_OPEN_REPORTING_PRIVACY = 10, 48 CMD_OPEN_REPORTING_PRIVACY = 10,
49 // Report a phishing error 49 // Report a phishing error
50 CMD_REPORT_PHISHING_ERROR = 11, 50 CMD_REPORT_PHISHING_ERROR = 11,
51 }; 51 };
52 52
53 // Provides methods for handling commands from the user, which requires some 53 // Provides methods for handling commands from the user, which requires some
54 // embedder-specific abstraction. This class should handle all commands sent 54 // embedder-specific abstraction. This class should handle all commands sent
55 // by the JavaScript error page. 55 // by the JavaScript error page.
56 class ControllerClient { 56 class ControllerClient {
57 public: 57 public:
58 ControllerClient(); 58 explicit ControllerClient(std::unique_ptr<MetricsHelper> metrics_helper);
59 virtual ~ControllerClient(); 59 virtual ~ControllerClient();
60 60
61 // Handle the user's reporting preferences. 61 // Handle the user's reporting preferences.
62 void SetReportingPreference(bool report); 62 void SetReportingPreference(bool report);
63 void OpenExtendedReportingPrivacyPolicy(); 63 void OpenExtendedReportingPrivacyPolicy();
64 64
65 // If available, open the operating system's date/time settings. 65 // If available, open the operating system's date/time settings.
66 virtual bool CanLaunchDateAndTimeSettings() = 0; 66 virtual bool CanLaunchDateAndTimeSettings() = 0;
67 virtual void LaunchDateAndTimeSettings() = 0; 67 virtual void LaunchDateAndTimeSettings() = 0;
68 68
69 // Close the error and go back to the previous page. 69 // Close the error and go back to the previous page.
70 virtual void GoBack() = 0; 70 virtual void GoBack() = 0;
71 71
72 // Close the error and proceed to the blocked page. 72 // Close the error and proceed to the blocked page.
73 virtual void Proceed() = 0; 73 virtual void Proceed() = 0;
74 74
75 // Reload the blocked page to see if it succeeds now. 75 // Reload the blocked page to see if it succeeds now.
76 virtual void Reload() = 0; 76 virtual void Reload() = 0;
77 77
78 MetricsHelper* metrics_helper() const; 78 MetricsHelper* metrics_helper() const;
79 void set_metrics_helper(std::unique_ptr<MetricsHelper> metrics_helper);
80 79
81 virtual void OpenUrlInCurrentTab(const GURL& url) = 0; 80 virtual void OpenUrlInCurrentTab(const GURL& url) = 0;
82 81
83 protected: 82 protected:
84 virtual const std::string& GetApplicationLocale() = 0; 83 virtual const std::string& GetApplicationLocale() = 0;
85 virtual PrefService* GetPrefService() = 0; 84 virtual PrefService* GetPrefService() = 0;
86 virtual const std::string GetExtendedReportingPrefName() = 0; 85 virtual const std::string GetExtendedReportingPrefName() = 0;
87 86
88 private: 87 private:
89 std::unique_ptr<MetricsHelper> metrics_helper_; 88 std::unique_ptr<MetricsHelper> metrics_helper_;
90 89
91 DISALLOW_COPY_AND_ASSIGN(ControllerClient); 90 DISALLOW_COPY_AND_ASSIGN(ControllerClient);
92 }; 91 };
93 92
94 } // namespace security_interstitials 93 } // namespace security_interstitials
95 94
96 #endif // COMPONENTS_SECURITY_INTERSTITIALS_CORE_CONTROLLER_CLIENT_H_ 95 #endif // COMPONENTS_SECURITY_INTERSTITIALS_CORE_CONTROLLER_CLIENT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698