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 22 matching lines...) Expand all Loading... |
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/chrome_metrics_helper.h" | 37 #include "chrome/browser/interstitials/chrome_metrics_helper.h" |
38 #include "chrome/browser/interstitials/security_interstitial_page.h" | 38 #include "chrome/browser/interstitials/security_interstitial_page.h" |
39 #include "chrome/browser/safe_browsing/ui_manager.h" | 39 #include "chrome/browser/safe_browsing/ui_manager.h" |
40 #include "content/public/browser/interstitial_page_delegate.h" | 40 #include "content/public/browser/interstitial_page_delegate.h" |
41 #include "url/gurl.h" | 41 #include "url/gurl.h" |
42 | 42 |
43 class ThreatDetails; | |
44 class SafeBrowsingBlockingPageFactory; | |
45 | |
46 namespace base { | 43 namespace base { |
47 class MessageLoop; | 44 class MessageLoop; |
48 } | 45 } |
49 | 46 |
| 47 namespace safe_browsing { |
| 48 |
| 49 class SafeBrowsingBlockingPageFactory; |
| 50 class ThreatDetails; |
| 51 |
50 class SafeBrowsingBlockingPage : public SecurityInterstitialPage { | 52 class SafeBrowsingBlockingPage : public SecurityInterstitialPage { |
51 public: | 53 public: |
52 typedef SafeBrowsingUIManager::UnsafeResource UnsafeResource; | 54 typedef SafeBrowsingUIManager::UnsafeResource UnsafeResource; |
53 typedef std::vector<UnsafeResource> UnsafeResourceList; | 55 typedef std::vector<UnsafeResource> UnsafeResourceList; |
54 typedef std::map<content::WebContents*, UnsafeResourceList> UnsafeResourceMap; | 56 typedef std::map<content::WebContents*, UnsafeResourceList> UnsafeResourceMap; |
55 | 57 |
56 // Interstitial type, used in tests. | 58 // Interstitial type, used in tests. |
57 static content::InterstitialPageDelegate::TypeID kTypeForTesting; | 59 static content::InterstitialPageDelegate::TypeID kTypeForTesting; |
58 | 60 |
59 ~SafeBrowsingBlockingPage() override; | 61 ~SafeBrowsingBlockingPage() override; |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
200 class SafeBrowsingBlockingPageFactory { | 202 class SafeBrowsingBlockingPageFactory { |
201 public: | 203 public: |
202 virtual ~SafeBrowsingBlockingPageFactory() { } | 204 virtual ~SafeBrowsingBlockingPageFactory() { } |
203 | 205 |
204 virtual SafeBrowsingBlockingPage* CreateSafeBrowsingPage( | 206 virtual SafeBrowsingBlockingPage* CreateSafeBrowsingPage( |
205 SafeBrowsingUIManager* ui_manager, | 207 SafeBrowsingUIManager* ui_manager, |
206 content::WebContents* web_contents, | 208 content::WebContents* web_contents, |
207 const SafeBrowsingBlockingPage::UnsafeResourceList& unsafe_resources) = 0; | 209 const SafeBrowsingBlockingPage::UnsafeResourceList& unsafe_resources) = 0; |
208 }; | 210 }; |
209 | 211 |
| 212 } // namespace safe_browsing |
| 213 |
210 #endif // CHROME_BROWSER_SAFE_BROWSING_SAFE_BROWSING_BLOCKING_PAGE_H_ | 214 #endif // CHROME_BROWSER_SAFE_BROWSING_SAFE_BROWSING_BLOCKING_PAGE_H_ |
OLD | NEW |