| 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 #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 | 7 |
| 8 // This class gets redirect chain for urls from the history service. | 8 // This class gets redirect chain for urls from the history service. |
| 9 | 9 |
| 10 #include <string> | 10 #include <string> |
| 11 #include <vector> | 11 #include <vector> |
| 12 | 12 |
| 13 #include "base/callback.h" | 13 #include "base/callback.h" |
| 14 #include "base/containers/hash_tables.h" | 14 #include "base/containers/hash_tables.h" |
| 15 #include "base/memory/linked_ptr.h" | 15 #include "base/memory/linked_ptr.h" |
| 16 #include "base/memory/ref_counted.h" | 16 #include "base/memory/ref_counted.h" |
| 17 #include "base/sequenced_task_runner_helpers.h" | 17 #include "base/sequenced_task_runner_helpers.h" |
| 18 #include "base/task/cancelable_task_tracker.h" | 18 #include "base/task/cancelable_task_tracker.h" |
| 19 #include "chrome/browser/history/history_service.h" | 19 #include "chrome/browser/history/history_service.h" |
| 20 #include "content/public/browser/browser_thread.h" | 20 #include "content/public/browser/browser_thread.h" |
| 21 #include "content/public/browser/notification_observer.h" | 21 #include "content/public/browser/notification_observer.h" |
| 22 #include "content/public/browser/notification_registrar.h" | 22 #include "content/public/browser/notification_registrar.h" |
| 23 #include "net/base/completion_callback.h" | 23 #include "net/base/completion_callback.h" |
| 24 | 24 |
| 25 namespace safe_browsing { | 25 namespace safe_browsing { |
| 26 typedef std::vector<GURL> RedirectChain; | 26 typedef std::vector<GURL> RedirectChain; |
| 27 } | 27 } |
| 28 | 28 |
| 29 class Profile; |
| 30 |
| 29 class MalwareDetailsRedirectsCollector | 31 class MalwareDetailsRedirectsCollector |
| 30 : public base::RefCountedThreadSafe< | 32 : public base::RefCountedThreadSafe< |
| 31 MalwareDetailsRedirectsCollector, | 33 MalwareDetailsRedirectsCollector, |
| 32 content::BrowserThread::DeleteOnUIThread>, | 34 content::BrowserThread::DeleteOnUIThread>, |
| 33 public content::NotificationObserver { | 35 public content::NotificationObserver { |
| 34 public: | 36 public: |
| 35 explicit MalwareDetailsRedirectsCollector(Profile* profile); | 37 explicit MalwareDetailsRedirectsCollector(Profile* profile); |
| 36 | 38 |
| 37 // Collects urls' redirects chain information from the history service. | 39 // Collects urls' redirects chain information from the history service. |
| 38 // We get access to history service via web_contents in UI thread. | 40 // We get access to history service via web_contents in UI thread. |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 std::vector<GURL>::iterator urls_it_; | 85 std::vector<GURL>::iterator urls_it_; |
| 84 // The collected directs from history service | 86 // The collected directs from history service |
| 85 std::vector<safe_browsing::RedirectChain> redirects_urls_; | 87 std::vector<safe_browsing::RedirectChain> redirects_urls_; |
| 86 | 88 |
| 87 content::NotificationRegistrar registrar_; | 89 content::NotificationRegistrar registrar_; |
| 88 | 90 |
| 89 DISALLOW_COPY_AND_ASSIGN(MalwareDetailsRedirectsCollector); | 91 DISALLOW_COPY_AND_ASSIGN(MalwareDetailsRedirectsCollector); |
| 90 }; | 92 }; |
| 91 | 93 |
| 92 #endif // CHROME_BROWSER_SAFE_BROWSING_MALWARE_DETAILS_HISTORY_H_ | 94 #endif // CHROME_BROWSER_SAFE_BROWSING_MALWARE_DETAILS_HISTORY_H_ |
| OLD | NEW |