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 // The Safe Browsing service is responsible for downloading anti-phishing and | 5 // The Safe Browsing service is responsible for downloading anti-phishing and |
6 // anti-malware tables and checking urls against them. | 6 // anti-malware tables and checking urls against them. |
7 | 7 |
8 #ifndef CHROME_BROWSER_SAFE_BROWSING_UI_MANAGER_H_ | 8 #ifndef CHROME_BROWSER_SAFE_BROWSING_UI_MANAGER_H_ |
9 #define CHROME_BROWSER_SAFE_BROWSING_UI_MANAGER_H_ | 9 #define CHROME_BROWSER_SAFE_BROWSING_UI_MANAGER_H_ |
10 | 10 |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 // on IO thread. If shutdown is true, the manager is disabled permanently. | 118 // on IO thread. If shutdown is true, the manager is disabled permanently. |
119 void StopOnIOThread(bool shutdown); | 119 void StopOnIOThread(bool shutdown); |
120 | 120 |
121 // Called on the UI thread to display an interstitial page. | 121 // Called on the UI thread to display an interstitial page. |
122 // |url| is the url of the resource that matches a safe browsing list. | 122 // |url| is the url of the resource that matches a safe browsing list. |
123 // If the request contained a chain of redirects, |url| is the last url | 123 // If the request contained a chain of redirects, |url| is the last url |
124 // in the chain, and |original_url| is the first one (the root of the | 124 // in the chain, and |original_url| is the first one (the root of the |
125 // chain). Otherwise, |original_url| = |url|. | 125 // chain). Otherwise, |original_url| = |url|. |
126 virtual void DisplayBlockingPage(const UnsafeResource& resource); | 126 virtual void DisplayBlockingPage(const UnsafeResource& resource); |
127 | 127 |
| 128 // A wrapper method for IsUrlWhitelistedForWebContents, for convenience. |
| 129 bool IsWhitelisted(const UnsafeResource& resource); |
| 130 |
128 // Returns true if we already displayed an interstitial for that top-level | 131 // Returns true if we already displayed an interstitial for that top-level |
129 // site in a given WebContents. Called on the UI thread. | 132 // site in a given WebContents. Called on the UI thread. |
130 bool IsWhitelisted(const UnsafeResource& resource); | 133 bool IsUrlWhitelistedForWebContents(const GURL& url, |
| 134 bool is_subresource, |
| 135 content::NavigationEntry* entry, |
| 136 content::WebContents* web_contents); |
131 | 137 |
132 // The blocking page on the UI thread has completed. | 138 // The blocking page on the UI thread has completed. |
133 void OnBlockingPageDone(const std::vector<UnsafeResource>& resources, | 139 void OnBlockingPageDone(const std::vector<UnsafeResource>& resources, |
134 bool proceed); | 140 bool proceed); |
135 | 141 |
136 // Log the user perceived delay caused by SafeBrowsing. This delay is the time | 142 // Log the user perceived delay caused by SafeBrowsing. This delay is the time |
137 // delta starting from when we would have started reading data from the | 143 // delta starting from when we would have started reading data from the |
138 // network, and ending when the SafeBrowsing check completes indicating that | 144 // network, and ending when the SafeBrowsing check completes indicating that |
139 // the current page is 'safe'. | 145 // the current page is 'safe'. |
140 void LogPauseDelay(base::TimeDelta time); | 146 void LogPauseDelay(base::TimeDelta time); |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
190 scoped_refptr<SafeBrowsingService> sb_service_; | 196 scoped_refptr<SafeBrowsingService> sb_service_; |
191 | 197 |
192 base::ObserverList<Observer> observer_list_; | 198 base::ObserverList<Observer> observer_list_; |
193 | 199 |
194 DISALLOW_COPY_AND_ASSIGN(SafeBrowsingUIManager); | 200 DISALLOW_COPY_AND_ASSIGN(SafeBrowsingUIManager); |
195 }; | 201 }; |
196 | 202 |
197 } // namespace safe_browsing | 203 } // namespace safe_browsing |
198 | 204 |
199 #endif // CHROME_BROWSER_SAFE_BROWSING_UI_MANAGER_H_ | 205 #endif // CHROME_BROWSER_SAFE_BROWSING_UI_MANAGER_H_ |
OLD | NEW |