OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 // Classes for managing the SafeBrowsing interstitial pages. | 5 // Classes for managing the SafeBrowsing interstitial pages. |
6 // | 6 // |
7 // When a user is about to visit a page the SafeBrowsing system has deemed to | 7 // When a user is about to visit a page the SafeBrowsing system has deemed to |
8 // be malicious, either as malware or a phishing page, we show an interstitial | 8 // be malicious, either as malware or a phishing page, we show an interstitial |
9 // page with some options (go back, continue) to give the user a chance to avoid | 9 // page with some options (go back, continue) to give the user a chance to avoid |
10 // the harmful page. | 10 // the harmful page. |
(...skipping 16 matching lines...) Expand all Loading... |
27 | 27 |
28 #ifndef CHROME_BROWSER_SAFE_BROWSING_SAFE_BROWSING_BLOCKING_PAGE_H_ | 28 #ifndef CHROME_BROWSER_SAFE_BROWSING_SAFE_BROWSING_BLOCKING_PAGE_H_ |
29 #define CHROME_BROWSER_SAFE_BROWSING_SAFE_BROWSING_BLOCKING_PAGE_H_ | 29 #define CHROME_BROWSER_SAFE_BROWSING_SAFE_BROWSING_BLOCKING_PAGE_H_ |
30 | 30 |
31 #include <map> | 31 #include <map> |
32 #include <string> | 32 #include <string> |
33 #include <vector> | 33 #include <vector> |
34 | 34 |
35 #include "base/gtest_prod_util.h" | 35 #include "base/gtest_prod_util.h" |
36 #include "base/task/cancelable_task_tracker.h" | 36 #include "base/task/cancelable_task_tracker.h" |
| 37 #include "chrome/browser/interstitials/security_interstitial_metrics_helper.h" |
37 #include "chrome/browser/interstitials/security_interstitial_page.h" | 38 #include "chrome/browser/interstitials/security_interstitial_page.h" |
38 #include "chrome/browser/interstitials/security_interstitial_uma_helper.h" | |
39 #include "chrome/browser/safe_browsing/ui_manager.h" | 39 #include "chrome/browser/safe_browsing/ui_manager.h" |
40 #include "url/gurl.h" | 40 #include "url/gurl.h" |
41 | 41 |
42 class MalwareDetails; | 42 class MalwareDetails; |
43 class SafeBrowsingBlockingPageFactory; | 43 class SafeBrowsingBlockingPageFactory; |
44 | 44 |
45 namespace base { | 45 namespace base { |
46 class MessageLoop; | 46 class MessageLoop; |
47 } | 47 } |
48 | 48 |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
184 static SafeBrowsingBlockingPageFactory* factory_; | 184 static SafeBrowsingBlockingPageFactory* factory_; |
185 | 185 |
186 private: | 186 private: |
187 // Fills the passed dictionary with the values to be passed to the template | 187 // Fills the passed dictionary with the values to be passed to the template |
188 // when creating the HTML. | 188 // when creating the HTML. |
189 void PopulateExtendedReportingOption(base::DictionaryValue* load_time_data); | 189 void PopulateExtendedReportingOption(base::DictionaryValue* load_time_data); |
190 void PopulateMalwareLoadTimeData(base::DictionaryValue* load_time_data); | 190 void PopulateMalwareLoadTimeData(base::DictionaryValue* load_time_data); |
191 void PopulateHarmfulLoadTimeData(base::DictionaryValue* load_time_data); | 191 void PopulateHarmfulLoadTimeData(base::DictionaryValue* load_time_data); |
192 void PopulatePhishingLoadTimeData(base::DictionaryValue* load_time_data); | 192 void PopulatePhishingLoadTimeData(base::DictionaryValue* load_time_data); |
193 | 193 |
194 std::string GetHistogramPrefix() const; | 194 std::string GetMetricPrefix() const; |
195 std::string GetSamplingEventName() const; | 195 std::string GetSamplingEventName() const; |
196 | 196 |
197 scoped_ptr<SecurityInterstitialUmaHelper> uma_helper_; | 197 scoped_ptr<SecurityInterstitialMetricsHelper> metrics_helper_; |
198 | 198 |
199 DISALLOW_COPY_AND_ASSIGN(SafeBrowsingBlockingPage); | 199 DISALLOW_COPY_AND_ASSIGN(SafeBrowsingBlockingPage); |
200 }; | 200 }; |
201 | 201 |
202 // Factory for creating SafeBrowsingBlockingPage. Useful for tests. | 202 // Factory for creating SafeBrowsingBlockingPage. Useful for tests. |
203 class SafeBrowsingBlockingPageFactory { | 203 class SafeBrowsingBlockingPageFactory { |
204 public: | 204 public: |
205 virtual ~SafeBrowsingBlockingPageFactory() { } | 205 virtual ~SafeBrowsingBlockingPageFactory() { } |
206 | 206 |
207 virtual SafeBrowsingBlockingPage* CreateSafeBrowsingPage( | 207 virtual SafeBrowsingBlockingPage* CreateSafeBrowsingPage( |
208 SafeBrowsingUIManager* ui_manager, | 208 SafeBrowsingUIManager* ui_manager, |
209 content::WebContents* web_contents, | 209 content::WebContents* web_contents, |
210 const SafeBrowsingBlockingPage::UnsafeResourceList& unsafe_resources) = 0; | 210 const SafeBrowsingBlockingPage::UnsafeResourceList& unsafe_resources) = 0; |
211 }; | 211 }; |
212 | 212 |
213 #endif // CHROME_BROWSER_SAFE_BROWSING_SAFE_BROWSING_BLOCKING_PAGE_H_ | 213 #endif // CHROME_BROWSER_SAFE_BROWSING_SAFE_BROWSING_BLOCKING_PAGE_H_ |
OLD | NEW |