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 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
273 const base::string16& description1, | 273 const base::string16& description1, |
274 const base::string16& description2, | 274 const base::string16& description2, |
275 const base::string16& description3); | 275 const base::string16& description3); |
276 | 276 |
277 // For the FieldTrial: this contains the name of the condition. | 277 // For the FieldTrial: this contains the name of the condition. |
278 std::string trialCondition_; | 278 std::string trialCondition_; |
279 | 279 |
280 DISALLOW_COPY_AND_ASSIGN(SafeBrowsingBlockingPageV2); | 280 DISALLOW_COPY_AND_ASSIGN(SafeBrowsingBlockingPageV2); |
281 }; | 281 }; |
282 | 282 |
283 class SafeBrowsingBlockingPageV3 : public SafeBrowsingBlockingPage { | |
Bernhard Bauer
2014/06/09 10:04:03
If this class isn't meant to be directly instantia
felt
2014/06/09 14:24:09
I copied the pattern the pattern that's already in
Bernhard Bauer
2014/06/09 14:45:41
If you don't mind shaving some yak, it would be a
felt
2014/06/09 15:24:02
I moved the V3 one into an anonymous namespace. I'
Bernhard Bauer
2014/06/09 15:43:00
Awesome, thanks!
| |
284 public: | |
285 // Don't instantiate this class directly, use ShowBlockingPage instead. | |
286 SafeBrowsingBlockingPageV3(SafeBrowsingUIManager* ui_manager, | |
287 content::WebContents* web_contents, | |
288 const UnsafeResourceList& unsafe_resources); | |
289 | |
290 // InterstitialPageDelegate method: | |
291 virtual std::string GetHTMLContents() OVERRIDE; | |
292 | |
293 private: | |
294 // Fills the passed dictionary with the values to be passed to the template | |
295 // when creating the HTML. | |
296 void PopulateMalwareLoadTimeData(base::DictionaryValue* load_time_data); | |
297 void PopulatePhishingLoadTimeData(base::DictionaryValue* load_time_data); | |
298 | |
299 DISALLOW_COPY_AND_ASSIGN(SafeBrowsingBlockingPageV3); | |
300 }; | |
301 | |
283 // Factory for creating SafeBrowsingBlockingPage. Useful for tests. | 302 // Factory for creating SafeBrowsingBlockingPage. Useful for tests. |
284 class SafeBrowsingBlockingPageFactory { | 303 class SafeBrowsingBlockingPageFactory { |
285 public: | 304 public: |
286 virtual ~SafeBrowsingBlockingPageFactory() { } | 305 virtual ~SafeBrowsingBlockingPageFactory() { } |
287 | 306 |
288 virtual SafeBrowsingBlockingPage* CreateSafeBrowsingPage( | 307 virtual SafeBrowsingBlockingPage* CreateSafeBrowsingPage( |
289 SafeBrowsingUIManager* ui_manager, | 308 SafeBrowsingUIManager* ui_manager, |
290 content::WebContents* web_contents, | 309 content::WebContents* web_contents, |
291 const SafeBrowsingBlockingPage::UnsafeResourceList& unsafe_resources) = 0; | 310 const SafeBrowsingBlockingPage::UnsafeResourceList& unsafe_resources) = 0; |
292 }; | 311 }; |
293 | 312 |
294 #endif // CHROME_BROWSER_SAFE_BROWSING_SAFE_BROWSING_BLOCKING_PAGE_H_ | 313 #endif // CHROME_BROWSER_SAFE_BROWSING_SAFE_BROWSING_BLOCKING_PAGE_H_ |
OLD | NEW |