Chromium Code Reviews| 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 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 95 // Checks the threat type to decide if we should report ThreatDetails. | 95 // Checks the threat type to decide if we should report ThreatDetails. |
| 96 static bool ShouldReportThreatDetails(SBThreatType threat_type); | 96 static bool ShouldReportThreatDetails(SBThreatType threat_type); |
| 97 | 97 |
| 98 protected: | 98 protected: |
| 99 friend class SafeBrowsingBlockingPageTest; | 99 friend class SafeBrowsingBlockingPageTest; |
| 100 FRIEND_TEST_ALL_PREFIXES(SafeBrowsingBlockingPageTest, | 100 FRIEND_TEST_ALL_PREFIXES(SafeBrowsingBlockingPageTest, |
| 101 ProceedThenDontProceed); | 101 ProceedThenDontProceed); |
| 102 FRIEND_TEST_ALL_PREFIXES(SafeBrowsingBlockingPageTest, | 102 FRIEND_TEST_ALL_PREFIXES(SafeBrowsingBlockingPageTest, |
| 103 MalwareReportsDisabled); | 103 MalwareReportsDisabled); |
| 104 FRIEND_TEST_ALL_PREFIXES(SafeBrowsingBlockingPageTest, | 104 FRIEND_TEST_ALL_PREFIXES(SafeBrowsingBlockingPageTest, |
| 105 MalwareReportsTransitionDisabled); | |
|
mattm
2015/12/28 17:56:30
MalwareReportsTransitionDisabled test doesn't seem
RaviKasibhatla
2015/12/29 05:35:07
Done.
| |
| 106 FRIEND_TEST_ALL_PREFIXES(SafeBrowsingBlockingPageTest, | |
| 105 MalwareReportsToggling); | 107 MalwareReportsToggling); |
| 106 FRIEND_TEST_ALL_PREFIXES(SafeBrowsingBlockingPageTest, | 108 FRIEND_TEST_ALL_PREFIXES(SafeBrowsingBlockingPageTest, |
| 107 ExtendedReportingNotShownOnSecurePage); | 109 ExtendedReportingNotShownOnSecurePage); |
| 108 FRIEND_TEST_ALL_PREFIXES( | 110 FRIEND_TEST_ALL_PREFIXES( |
| 109 SafeBrowsingBlockingPageTest, | 111 SafeBrowsingBlockingPageTest, |
| 110 ExtendedReportingNotShownOnSecurePageWithSecureSubresource); | 112 ExtendedReportingNotShownOnSecurePageWithSecureSubresource); |
| 111 FRIEND_TEST_ALL_PREFIXES( | 113 FRIEND_TEST_ALL_PREFIXES( |
| 112 SafeBrowsingBlockingPageTest, | 114 SafeBrowsingBlockingPageTest, |
| 113 ExtendedReportingNotShownOnSecurePageWithInsecureSubresource); | 115 ExtendedReportingNotShownOnSecurePageWithInsecureSubresource); |
| 114 FRIEND_TEST_ALL_PREFIXES( | 116 FRIEND_TEST_ALL_PREFIXES( |
| (...skipping 16 matching lines...) Expand all Loading... | |
| 131 void PopulateInterstitialStrings( | 133 void PopulateInterstitialStrings( |
| 132 base::DictionaryValue* load_time_data) override; | 134 base::DictionaryValue* load_time_data) override; |
| 133 void AfterShow() override {} | 135 void AfterShow() override {} |
| 134 | 136 |
| 135 // After a safe browsing interstitial where the user opted-in to the | 137 // After a safe browsing interstitial where the user opted-in to the |
| 136 // report but clicked "proceed anyway", we delay the call to | 138 // report but clicked "proceed anyway", we delay the call to |
| 137 // ThreatDetails::FinishCollection() by this much time (in | 139 // ThreatDetails::FinishCollection() by this much time (in |
| 138 // milliseconds), in order to get data from the blocked resource itself. | 140 // milliseconds), in order to get data from the blocked resource itself. |
| 139 int64_t malware_details_proceed_delay_ms_; | 141 int64_t malware_details_proceed_delay_ms_; |
| 140 | 142 |
| 141 FRIEND_TEST_ALL_PREFIXES(SafeBrowsingBlockingPageTest, | |
| 142 MalwareReportsTransitionDisabled); | |
| 143 FRIEND_TEST_ALL_PREFIXES(SafeBrowsingBlockingPageTest, | |
| 144 MalwareReportsToggling); | |
| 145 | |
| 146 // Checks if we should even show the threat details option. For example, we | 143 // Checks if we should even show the threat details option. For example, we |
| 147 // don't show it in incognito mode. | 144 // don't show it in incognito mode. |
| 148 bool CanShowThreatDetailsOption(); | 145 bool CanShowThreatDetailsOption(); |
| 149 | 146 |
| 150 // Called when the insterstitial is going away. If there is a | 147 // Called when the insterstitial is going away. If there is a |
| 151 // pending threat details object, we look at the user's | 148 // pending threat details object, we look at the user's |
| 152 // preferences, and if the option to send threat details is | 149 // preferences, and if the option to send threat details is |
| 153 // enabled, the report is scheduled to be sent on the |ui_manager_|. | 150 // enabled, the report is scheduled to be sent on the |ui_manager_|. |
| 154 void FinishThreatDetails(int64_t delay_ms, bool did_proceed, int num_visits); | 151 void FinishThreatDetails(int64_t delay_ms, bool did_proceed, int num_visits); |
| 155 | 152 |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 227 virtual SafeBrowsingBlockingPage* CreateSafeBrowsingPage( | 224 virtual SafeBrowsingBlockingPage* CreateSafeBrowsingPage( |
| 228 SafeBrowsingUIManager* ui_manager, | 225 SafeBrowsingUIManager* ui_manager, |
| 229 content::WebContents* web_contents, | 226 content::WebContents* web_contents, |
| 230 const GURL& main_frame_url, | 227 const GURL& main_frame_url, |
| 231 const SafeBrowsingBlockingPage::UnsafeResourceList& unsafe_resources) = 0; | 228 const SafeBrowsingBlockingPage::UnsafeResourceList& unsafe_resources) = 0; |
| 232 }; | 229 }; |
| 233 | 230 |
| 234 } // namespace safe_browsing | 231 } // namespace safe_browsing |
| 235 | 232 |
| 236 #endif // CHROME_BROWSER_SAFE_BROWSING_SAFE_BROWSING_BLOCKING_PAGE_H_ | 233 #endif // CHROME_BROWSER_SAFE_BROWSING_SAFE_BROWSING_BLOCKING_PAGE_H_ |
| OLD | NEW |