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 21 matching lines...) Expand all Loading... |
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/time.h" | 36 #include "base/time.h" |
37 #include "chrome/browser/safe_browsing/ui_manager.h" | 37 #include "chrome/browser/safe_browsing/ui_manager.h" |
38 #include "content/public/browser/interstitial_page_delegate.h" | 38 #include "content/public/browser/interstitial_page_delegate.h" |
39 #include "googleurl/src/gurl.h" | 39 #include "googleurl/src/gurl.h" |
40 | 40 |
41 class MalwareDetails; | 41 class MalwareDetails; |
42 class MessageLoop; | |
43 class SafeBrowsingBlockingPageFactory; | 42 class SafeBrowsingBlockingPageFactory; |
44 | 43 |
45 namespace base { | 44 namespace base { |
46 class DictionaryValue; | 45 class DictionaryValue; |
| 46 class MessageLoop; |
47 } | 47 } |
48 | 48 |
49 namespace content { | 49 namespace content { |
50 class InterstitialPage; | 50 class InterstitialPage; |
51 class WebContents; | 51 class WebContents; |
52 } | 52 } |
53 | 53 |
54 class SafeBrowsingBlockingPage : public content::InterstitialPageDelegate { | 54 class SafeBrowsingBlockingPage : public content::InterstitialPageDelegate { |
55 public: | 55 public: |
56 typedef SafeBrowsingUIManager::UnsafeResource UnsafeResource; | 56 typedef SafeBrowsingUIManager::UnsafeResource UnsafeResource; |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 | 149 |
150 // Returns true if the passed |unsafe_resources| is blocking the load of | 150 // Returns true if the passed |unsafe_resources| is blocking the load of |
151 // the main page. | 151 // the main page. |
152 static bool IsMainPageLoadBlocked( | 152 static bool IsMainPageLoadBlocked( |
153 const UnsafeResourceList& unsafe_resources); | 153 const UnsafeResourceList& unsafe_resources); |
154 | 154 |
155 friend class SafeBrowsingBlockingPageFactoryImpl; | 155 friend class SafeBrowsingBlockingPageFactoryImpl; |
156 | 156 |
157 // For reporting back user actions. | 157 // For reporting back user actions. |
158 SafeBrowsingUIManager* ui_manager_; | 158 SafeBrowsingUIManager* ui_manager_; |
159 MessageLoop* report_loop_; | 159 base::MessageLoop* report_loop_; |
160 | 160 |
161 // True if the interstitial is blocking the main page because it is on one | 161 // True if the interstitial is blocking the main page because it is on one |
162 // of our lists. False if a subresource is being blocked, or in the case of | 162 // of our lists. False if a subresource is being blocked, or in the case of |
163 // client-side detection where the interstitial is shown after page load | 163 // client-side detection where the interstitial is shown after page load |
164 // finishes. | 164 // finishes. |
165 bool is_main_frame_load_blocked_; | 165 bool is_main_frame_load_blocked_; |
166 | 166 |
167 // The index of a navigation entry that should be removed when DontProceed() | 167 // The index of a navigation entry that should be removed when DontProceed() |
168 // is invoked, -1 if not entry should be removed. | 168 // is invoked, -1 if not entry should be removed. |
169 int navigation_entry_index_to_remove_; | 169 int navigation_entry_index_to_remove_; |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
270 public: | 270 public: |
271 virtual ~SafeBrowsingBlockingPageFactory() { } | 271 virtual ~SafeBrowsingBlockingPageFactory() { } |
272 | 272 |
273 virtual SafeBrowsingBlockingPage* CreateSafeBrowsingPage( | 273 virtual SafeBrowsingBlockingPage* CreateSafeBrowsingPage( |
274 SafeBrowsingUIManager* ui_manager, | 274 SafeBrowsingUIManager* ui_manager, |
275 content::WebContents* web_contents, | 275 content::WebContents* web_contents, |
276 const SafeBrowsingBlockingPage::UnsafeResourceList& unsafe_resources) = 0; | 276 const SafeBrowsingBlockingPage::UnsafeResourceList& unsafe_resources) = 0; |
277 }; | 277 }; |
278 | 278 |
279 #endif // CHROME_BROWSER_SAFE_BROWSING_SAFE_BROWSING_BLOCKING_PAGE_H_ | 279 #endif // CHROME_BROWSER_SAFE_BROWSING_SAFE_BROWSING_BLOCKING_PAGE_H_ |
OLD | NEW |