OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 CHROME_BROWSER_SAFE_BROWSING_MALWARE_DETAILS_HISTORY_H_ | 5 #ifndef CHROME_BROWSER_SAFE_BROWSING_MALWARE_DETAILS_HISTORY_H_ |
6 #define CHROME_BROWSER_SAFE_BROWSING_MALWARE_DETAILS_HISTORY_H_ | 6 #define CHROME_BROWSER_SAFE_BROWSING_MALWARE_DETAILS_HISTORY_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 // This class gets redirect chain for urls from the history service. | 9 // This class gets redirect chain for urls from the history service. |
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/hash_tables.h" | 15 #include "base/hash_tables.h" |
16 #include "base/memory/linked_ptr.h" | 16 #include "base/memory/linked_ptr.h" |
17 #include "base/memory/ref_counted.h" | 17 #include "base/memory/ref_counted.h" |
18 #include "chrome/browser/history/history.h" | 18 #include "chrome/browser/history/history.h" |
19 #include "content/public/browser/browser_thread.h" | 19 #include "content/public/browser/browser_thread.h" |
20 #include "content/public/browser/notification_observer.h" | 20 #include "content/public/browser/notification_observer.h" |
21 #include "content/public/browser/notification_registrar.h" | 21 #include "content/public/browser/notification_registrar.h" |
22 #include "net/base/completion_callback.h" | 22 #include "net/base/completion_callback.h" |
23 | 23 |
24 class TabContents; | |
25 | |
26 namespace safe_browsing { | 24 namespace safe_browsing { |
27 typedef std::vector<GURL> RedirectChain; | 25 typedef std::vector<GURL> RedirectChain; |
28 } | 26 } |
29 | 27 |
30 class MalwareDetailsRedirectsCollector | 28 class MalwareDetailsRedirectsCollector |
31 : public base::RefCountedThreadSafe< | 29 : public base::RefCountedThreadSafe< |
32 MalwareDetailsRedirectsCollector, | 30 MalwareDetailsRedirectsCollector, |
33 content::BrowserThread::DeleteOnUIThread>, | 31 content::BrowserThread::DeleteOnUIThread>, |
34 public content::NotificationObserver { | 32 public content::NotificationObserver { |
35 | |
36 public: | 33 public: |
37 explicit MalwareDetailsRedirectsCollector(Profile* profile); | 34 explicit MalwareDetailsRedirectsCollector(Profile* profile); |
38 virtual ~MalwareDetailsRedirectsCollector(); | 35 virtual ~MalwareDetailsRedirectsCollector(); |
39 | 36 |
40 // Collects urls' redirects chain information from the history service. | 37 // Collects urls' redirects chain information from the history service. |
41 // We get access to history service via tab_contents in UI thread. | 38 // We get access to history service via tab_contents in UI thread. |
42 // Notice the callback will be posted to the IO thread. | 39 // Notice the callback will be posted to the IO thread. |
43 void StartHistoryCollection(const std::vector<GURL>& urls, | 40 void StartHistoryCollection(const std::vector<GURL>& urls, |
44 const base::Closure& callback); | 41 const base::Closure& callback); |
45 | 42 |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 void AllDone(); | 82 void AllDone(); |
86 | 83 |
87 virtual void Observe(int type, | 84 virtual void Observe(int type, |
88 const content::NotificationSource& source, | 85 const content::NotificationSource& source, |
89 const content::NotificationDetails& details) OVERRIDE; | 86 const content::NotificationDetails& details) OVERRIDE; |
90 | 87 |
91 DISALLOW_COPY_AND_ASSIGN(MalwareDetailsRedirectsCollector); | 88 DISALLOW_COPY_AND_ASSIGN(MalwareDetailsRedirectsCollector); |
92 }; | 89 }; |
93 | 90 |
94 #endif // CHROME_BROWSER_SAFE_BROWSING_MALWARE_DETAILS_HISTORY_H_ | 91 #endif // CHROME_BROWSER_SAFE_BROWSING_MALWARE_DETAILS_HISTORY_H_ |
OLD | NEW |