| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 #ifndef COMPONENTS_SAFE_BROWSING_BASE_UI_MANAGER_H_ | 5 #ifndef COMPONENTS_SAFE_BROWSING_BASE_UI_MANAGER_H_ |
| 6 #define COMPONENTS_SAFE_BROWSING_BASE_UI_MANAGER_H_ | 6 #define COMPONENTS_SAFE_BROWSING_BASE_UI_MANAGER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 // the current page is 'safe'. | 54 // the current page is 'safe'. |
| 55 virtual void LogPauseDelay(base::TimeDelta time); | 55 virtual void LogPauseDelay(base::TimeDelta time); |
| 56 | 56 |
| 57 // This is a no-op in the base class, but should be overridden to send threat | 57 // This is a no-op in the base class, but should be overridden to send threat |
| 58 // details. Called on the IO thread by the ThreatDetails with the serialized | 58 // details. Called on the IO thread by the ThreatDetails with the serialized |
| 59 // protocol buffer. | 59 // protocol buffer. |
| 60 virtual void SendSerializedThreatDetails(const std::string& serialized); | 60 virtual void SendSerializedThreatDetails(const std::string& serialized); |
| 61 | 61 |
| 62 // This is a no-op in the base class, but should be overridden to report hits | 62 // This is a no-op in the base class, but should be overridden to report hits |
| 63 // to the unsafe contents (malware, phishing, unsafe download URL) | 63 // to the unsafe contents (malware, phishing, unsafe download URL) |
| 64 // to the server. Can only be called on UI thread. | 64 // to the server. Can only be called on UI thread. Will only upload a hit |
| 65 // report if the user has enabled SBER and is not currently in incognito mode. |
| 65 virtual void MaybeReportSafeBrowsingHit( | 66 virtual void MaybeReportSafeBrowsingHit( |
| 66 const safe_browsing::HitReport& hit_report, | 67 const safe_browsing::HitReport& hit_report, |
| 67 content::WebContents* web_contents); | 68 const content::WebContents* web_contents); |
| 68 | 69 |
| 69 // A convenience wrapper method for IsUrlWhitelistedOrPendingForWebContents. | 70 // A convenience wrapper method for IsUrlWhitelistedOrPendingForWebContents. |
| 70 virtual bool IsWhitelisted(const UnsafeResource& resource); | 71 virtual bool IsWhitelisted(const UnsafeResource& resource); |
| 71 | 72 |
| 72 // Checks if we already displayed or are displaying an interstitial | 73 // Checks if we already displayed or are displaying an interstitial |
| 73 // for the top-level site |url| in a given WebContents. If | 74 // for the top-level site |url| in a given WebContents. If |
| 74 // |whitelist_only|, it returns true only if the user chose to ignore | 75 // |whitelist_only|, it returns true only if the user chose to ignore |
| 75 // the interstitial. Otherwise, it returns true if an interstitial for | 76 // the interstitial. Otherwise, it returns true if an interstitial for |
| 76 // |url| is already displaying *or* if the user has seen an | 77 // |url| is already displaying *or* if the user has seen an |
| 77 // interstitial for |url| before in this WebContents and proceeded | 78 // interstitial for |url| before in this WebContents and proceeded |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 | 148 |
| 148 private: | 149 private: |
| 149 friend class base::RefCountedThreadSafe<BaseUIManager>; | 150 friend class base::RefCountedThreadSafe<BaseUIManager>; |
| 150 | 151 |
| 151 DISALLOW_COPY_AND_ASSIGN(BaseUIManager); | 152 DISALLOW_COPY_AND_ASSIGN(BaseUIManager); |
| 152 }; | 153 }; |
| 153 | 154 |
| 154 } // namespace safe_browsing | 155 } // namespace safe_browsing |
| 155 | 156 |
| 156 #endif // COMPONENTS_SAFE_BROWSING_BASE_UI_MANAGER_H_ | 157 #endif // COMPONENTS_SAFE_BROWSING_BASE_UI_MANAGER_H_ |
| OLD | NEW |