| 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 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 return interstitial_page_; | 104 return interstitial_page_; |
| 105 } | 105 } |
| 106 | 106 |
| 107 FRIEND_TEST_ALL_PREFIXES(SafeBrowsingBlockingPageTest, MalwareReports); | 107 FRIEND_TEST_ALL_PREFIXES(SafeBrowsingBlockingPageTest, MalwareReports); |
| 108 FRIEND_TEST_ALL_PREFIXES(SafeBrowsingBlockingPageV2Test, MalwareReports); | 108 FRIEND_TEST_ALL_PREFIXES(SafeBrowsingBlockingPageV2Test, MalwareReports); |
| 109 | 109 |
| 110 enum BlockingPageEvent { | 110 enum BlockingPageEvent { |
| 111 SHOW, | 111 SHOW, |
| 112 PROCEED, | 112 PROCEED, |
| 113 DONT_PROCEED, | 113 DONT_PROCEED, |
| 114 SHOW_ADVANCED, |
| 114 }; | 115 }; |
| 115 | 116 |
| 116 // Records a user action for this interstitial, using the form | 117 // Records a user action for this interstitial, using the form |
| 117 // SBInterstitial[Phishing|Malware|Multiple][Show|Proceed|DontProceed]. | 118 // SBInterstitial[Phishing|Malware|Multiple][Show|Proceed|DontProceed]. |
| 118 void RecordUserAction(BlockingPageEvent event); | 119 void RecordUserAction(BlockingPageEvent event); |
| 119 | 120 |
| 120 // Records the time it took for the user to react to the | 121 // Records the time it took for the user to react to the |
| 121 // interstitial. We won't double-count if this method is called | 122 // interstitial. We won't double-count if this method is called |
| 122 // multiple times. | 123 // multiple times. |
| 123 void RecordUserReactionTime(const std::string& command); | 124 void RecordUserReactionTime(const std::string& command); |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 255 | 256 |
| 256 // A helper method used by the Populate methods above used to populate common | 257 // A helper method used by the Populate methods above used to populate common |
| 257 // fields. | 258 // fields. |
| 258 void PopulateStringDictionary(base::DictionaryValue* strings, | 259 void PopulateStringDictionary(base::DictionaryValue* strings, |
| 259 const string16& title, | 260 const string16& title, |
| 260 const string16& headline, | 261 const string16& headline, |
| 261 const string16& description1, | 262 const string16& description1, |
| 262 const string16& description2, | 263 const string16& description2, |
| 263 const string16& description3); | 264 const string16& description3); |
| 264 | 265 |
| 266 // For the FieldTrial: this contains the name of the condition. |
| 267 std::string trialCondition_; |
| 268 |
| 265 DISALLOW_COPY_AND_ASSIGN(SafeBrowsingBlockingPageV2); | 269 DISALLOW_COPY_AND_ASSIGN(SafeBrowsingBlockingPageV2); |
| 266 }; | 270 }; |
| 267 | 271 |
| 268 // Factory for creating SafeBrowsingBlockingPage. Useful for tests. | 272 // Factory for creating SafeBrowsingBlockingPage. Useful for tests. |
| 269 class SafeBrowsingBlockingPageFactory { | 273 class SafeBrowsingBlockingPageFactory { |
| 270 public: | 274 public: |
| 271 virtual ~SafeBrowsingBlockingPageFactory() { } | 275 virtual ~SafeBrowsingBlockingPageFactory() { } |
| 272 | 276 |
| 273 virtual SafeBrowsingBlockingPage* CreateSafeBrowsingPage( | 277 virtual SafeBrowsingBlockingPage* CreateSafeBrowsingPage( |
| 274 SafeBrowsingUIManager* ui_manager, | 278 SafeBrowsingUIManager* ui_manager, |
| 275 content::WebContents* web_contents, | 279 content::WebContents* web_contents, |
| 276 const SafeBrowsingBlockingPage::UnsafeResourceList& unsafe_resources) = 0; | 280 const SafeBrowsingBlockingPage::UnsafeResourceList& unsafe_resources) = 0; |
| 277 }; | 281 }; |
| 278 | 282 |
| 279 #endif // CHROME_BROWSER_SAFE_BROWSING_SAFE_BROWSING_BLOCKING_PAGE_H_ | 283 #endif // CHROME_BROWSER_SAFE_BROWSING_SAFE_BROWSING_BLOCKING_PAGE_H_ |
| OLD | NEW |