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 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 // Checks if we should even show the malware details option. For example, we | 139 // Checks if we should even show the malware details option. For example, we |
140 // don't show it in incognito mode. | 140 // don't show it in incognito mode. |
141 bool CanShowMalwareDetailsOption(); | 141 bool CanShowMalwareDetailsOption(); |
142 | 142 |
143 // Called when the insterstitial is going away. If there is a | 143 // Called when the insterstitial is going away. If there is a |
144 // pending malware details object, we look at the user's | 144 // pending malware details object, we look at the user's |
145 // preferences, and if the option to send malware details is | 145 // preferences, and if the option to send malware details is |
146 // enabled, the report is scheduled to be sent on the |sb_service_|. | 146 // enabled, the report is scheduled to be sent on the |sb_service_|. |
147 void FinishMalwareDetails(int64 delay_ms); | 147 void FinishMalwareDetails(int64 delay_ms); |
148 | 148 |
| 149 // Returns the boolean value of the given |pref| from the PrefService of the |
| 150 // Profile associated with |web_contents_|. |
| 151 bool IsPrefEnabled(const char* pref); |
| 152 |
149 // A list of SafeBrowsingService::UnsafeResource for a tab that the user | 153 // A list of SafeBrowsingService::UnsafeResource for a tab that the user |
150 // should be warned about. They are queued when displaying more than one | 154 // should be warned about. They are queued when displaying more than one |
151 // interstitial at a time. | 155 // interstitial at a time. |
152 static UnsafeResourceMap* GetUnsafeResourcesMap(); | 156 static UnsafeResourceMap* GetUnsafeResourcesMap(); |
153 | 157 |
154 // Notifies the SafeBrowsingService on the IO thread whether to proceed or not | 158 // Notifies the SafeBrowsingService on the IO thread whether to proceed or not |
155 // for the |resources|. | 159 // for the |resources|. |
156 static void NotifySafeBrowsingService(SafeBrowsingService* sb_service, | 160 static void NotifySafeBrowsingService(SafeBrowsingService* sb_service, |
157 const UnsafeResourceList& resources, | 161 const UnsafeResourceList& resources, |
158 bool proceed); | 162 bool proceed); |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
215 public: | 219 public: |
216 virtual ~SafeBrowsingBlockingPageFactory() { } | 220 virtual ~SafeBrowsingBlockingPageFactory() { } |
217 | 221 |
218 virtual SafeBrowsingBlockingPage* CreateSafeBrowsingPage( | 222 virtual SafeBrowsingBlockingPage* CreateSafeBrowsingPage( |
219 SafeBrowsingService* service, | 223 SafeBrowsingService* service, |
220 content::WebContents* web_contents, | 224 content::WebContents* web_contents, |
221 const SafeBrowsingBlockingPage::UnsafeResourceList& unsafe_resources) = 0; | 225 const SafeBrowsingBlockingPage::UnsafeResourceList& unsafe_resources) = 0; |
222 }; | 226 }; |
223 | 227 |
224 #endif // CHROME_BROWSER_SAFE_BROWSING_SAFE_BROWSING_BLOCKING_PAGE_H_ | 228 #endif // CHROME_BROWSER_SAFE_BROWSING_SAFE_BROWSING_BLOCKING_PAGE_H_ |
OLD | NEW |