| 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 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 197 class SafeBrowsingBlockingPageFactory { | 199 class SafeBrowsingBlockingPageFactory { |
| 198 public: | 200 public: |
| 199 virtual ~SafeBrowsingBlockingPageFactory() { } | 201 virtual ~SafeBrowsingBlockingPageFactory() { } |
| 200 | 202 |
| 201 virtual SafeBrowsingBlockingPage* CreateSafeBrowsingPage( | 203 virtual SafeBrowsingBlockingPage* CreateSafeBrowsingPage( |
| 202 SafeBrowsingUIManager* ui_manager, | 204 SafeBrowsingUIManager* ui_manager, |
| 203 content::WebContents* web_contents, | 205 content::WebContents* web_contents, |
| 204 const SafeBrowsingBlockingPage::UnsafeResourceList& unsafe_resources) = 0; | 206 const SafeBrowsingBlockingPage::UnsafeResourceList& unsafe_resources) = 0; |
| 205 }; | 207 }; |
| 206 | 208 |
| 209 } // namespace safe_browsing |
| 210 |
| 207 #endif // CHROME_BROWSER_SAFE_BROWSING_SAFE_BROWSING_BLOCKING_PAGE_H_ | 211 #endif // CHROME_BROWSER_SAFE_BROWSING_SAFE_BROWSING_BLOCKING_PAGE_H_ |
| OLD | NEW |