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 |
11 #include <string> | 11 #include <string> |
12 #include <vector> | 12 #include <vector> |
13 | 13 |
14 #include "base/callback.h" | 14 #include "base/callback.h" |
15 #include "base/memory/ref_counted.h" | 15 #include "base/memory/ref_counted.h" |
16 #include "base/memory/scoped_ptr.h" | 16 #include "base/memory/scoped_ptr.h" |
17 #include "base/observer_list.h" | 17 #include "base/observer_list.h" |
18 #include "base/time/time.h" | 18 #include "base/time/time.h" |
19 #include "chrome/browser/safe_browsing/safe_browsing_util.h" | 19 #include "chrome/browser/safe_browsing/safe_browsing_util.h" |
20 #include "url/gurl.h" | 20 #include "url/gurl.h" |
21 | 21 |
22 class SafeBrowsingService; | |
23 | |
24 namespace base { | 22 namespace base { |
25 class Thread; | 23 class Thread; |
26 } // namespace base | 24 } // namespace base |
27 | 25 |
28 namespace net { | 26 namespace net { |
29 class SSLInfo; | 27 class SSLInfo; |
30 } // namespace net | 28 } // namespace net |
31 | 29 |
| 30 namespace safe_browsing { |
| 31 |
| 32 class SafeBrowsingService; |
| 33 |
32 // Construction needs to happen on the main thread. | 34 // Construction needs to happen on the main thread. |
33 class SafeBrowsingUIManager | 35 class SafeBrowsingUIManager |
34 : public base::RefCountedThreadSafe<SafeBrowsingUIManager> { | 36 : public base::RefCountedThreadSafe<SafeBrowsingUIManager> { |
35 public: | 37 public: |
36 // Passed a boolean indicating whether or not it is OK to proceed with | 38 // Passed a boolean indicating whether or not it is OK to proceed with |
37 // loading an URL. | 39 // loading an URL. |
38 typedef base::Callback<void(bool /*proceed*/)> UrlCheckCallback; | 40 typedef base::Callback<void(bool /*proceed*/)> UrlCheckCallback; |
39 | 41 |
40 // What service classified this threat as unsafe. | 42 // What service classified this threat as unsafe. |
41 enum ThreatSource { | 43 enum ThreatSource { |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 void AddToWhitelist(const UnsafeResource& resource); | 168 void AddToWhitelist(const UnsafeResource& resource); |
167 | 169 |
168 // Safebrowsing service. | 170 // Safebrowsing service. |
169 scoped_refptr<SafeBrowsingService> sb_service_; | 171 scoped_refptr<SafeBrowsingService> sb_service_; |
170 | 172 |
171 base::ObserverList<Observer> observer_list_; | 173 base::ObserverList<Observer> observer_list_; |
172 | 174 |
173 DISALLOW_COPY_AND_ASSIGN(SafeBrowsingUIManager); | 175 DISALLOW_COPY_AND_ASSIGN(SafeBrowsingUIManager); |
174 }; | 176 }; |
175 | 177 |
| 178 } // namespace safe_browsing |
| 179 |
176 #endif // CHROME_BROWSER_SAFE_BROWSING_UI_MANAGER_H_ | 180 #endif // CHROME_BROWSER_SAFE_BROWSING_UI_MANAGER_H_ |
OLD | NEW |