| 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 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 274 | 274 |
| 275 // A helper method used by the Populate methods above used to populate common | 275 // A helper method used by the Populate methods above used to populate common |
| 276 // fields. | 276 // fields. |
| 277 void PopulateStringDictionary(base::DictionaryValue* strings, | 277 void PopulateStringDictionary(base::DictionaryValue* strings, |
| 278 const base::string16& title, | 278 const base::string16& title, |
| 279 const base::string16& headline, | 279 const base::string16& headline, |
| 280 const base::string16& description1, | 280 const base::string16& description1, |
| 281 const base::string16& description2, | 281 const base::string16& description2, |
| 282 const base::string16& description3); | 282 const base::string16& description3); |
| 283 | 283 |
| 284 // For the FieldTrial: this contains the name of the condition. | |
| 285 std::string trialCondition_; | |
| 286 | |
| 287 DISALLOW_COPY_AND_ASSIGN(SafeBrowsingBlockingPageV2); | 284 DISALLOW_COPY_AND_ASSIGN(SafeBrowsingBlockingPageV2); |
| 288 }; | 285 }; |
| 289 | 286 |
| 290 class SafeBrowsingBlockingPageV3 : public SafeBrowsingBlockingPage { | 287 class SafeBrowsingBlockingPageV3 : public SafeBrowsingBlockingPage { |
| 291 public: | 288 public: |
| 292 SafeBrowsingBlockingPageV3(SafeBrowsingUIManager* ui_manager, | 289 SafeBrowsingBlockingPageV3(SafeBrowsingUIManager* ui_manager, |
| 293 content::WebContents* web_contents, | 290 content::WebContents* web_contents, |
| 294 const UnsafeResourceList& unsafe_resources); | 291 const UnsafeResourceList& unsafe_resources); |
| 295 | 292 |
| 296 // InterstitialPageDelegate method: | 293 // InterstitialPageDelegate method: |
| 297 virtual std::string GetHTMLContents() OVERRIDE; | 294 virtual std::string GetHTMLContents() OVERRIDE; |
| 298 | 295 |
| 299 private: | 296 private: |
| 300 // Fills the passed dictionary with the values to be passed to the template | 297 // Fills the passed dictionary with the values to be passed to the template |
| 301 // when creating the HTML. | 298 // when creating the HTML. |
| 302 void PopulateMalwareLoadTimeData(base::DictionaryValue* load_time_data); | 299 void PopulateMalwareLoadTimeData(base::DictionaryValue* load_time_data); |
| 303 void PopulatePhishingLoadTimeData(base::DictionaryValue* load_time_data); | 300 void PopulatePhishingLoadTimeData(base::DictionaryValue* load_time_data); |
| 304 | 301 |
| 302 // For the M37 FieldTrial: this contains the name of the condition. |
| 303 std::string trial_condition_; |
| 304 |
| 305 DISALLOW_COPY_AND_ASSIGN(SafeBrowsingBlockingPageV3); | 305 DISALLOW_COPY_AND_ASSIGN(SafeBrowsingBlockingPageV3); |
| 306 }; | 306 }; |
| 307 | 307 |
| 308 // Factory for creating SafeBrowsingBlockingPage. Useful for tests. | 308 // Factory for creating SafeBrowsingBlockingPage. Useful for tests. |
| 309 class SafeBrowsingBlockingPageFactory { | 309 class SafeBrowsingBlockingPageFactory { |
| 310 public: | 310 public: |
| 311 virtual ~SafeBrowsingBlockingPageFactory() { } | 311 virtual ~SafeBrowsingBlockingPageFactory() { } |
| 312 | 312 |
| 313 virtual SafeBrowsingBlockingPage* CreateSafeBrowsingPage( | 313 virtual SafeBrowsingBlockingPage* CreateSafeBrowsingPage( |
| 314 SafeBrowsingUIManager* ui_manager, | 314 SafeBrowsingUIManager* ui_manager, |
| 315 content::WebContents* web_contents, | 315 content::WebContents* web_contents, |
| 316 const SafeBrowsingBlockingPage::UnsafeResourceList& unsafe_resources) = 0; | 316 const SafeBrowsingBlockingPage::UnsafeResourceList& unsafe_resources) = 0; |
| 317 }; | 317 }; |
| 318 | 318 |
| 319 #endif // CHROME_BROWSER_SAFE_BROWSING_SAFE_BROWSING_BLOCKING_PAGE_H_ | 319 #endif // CHROME_BROWSER_SAFE_BROWSING_SAFE_BROWSING_BLOCKING_PAGE_H_ |
| OLD | NEW |