| 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 // Implementation of the MalwareDetailsRedirectsCollector class. | 5 // Implementation of the MalwareDetailsRedirectsCollector class. |
| 6 | 6 |
| 7 #include "chrome/browser/safe_browsing/malware_details_history.h" | 7 #include "chrome/browser/safe_browsing/malware_details_history.h" |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| 11 #include "chrome/browser/profiles/profile.h" | 11 #include "chrome/browser/profiles/profile.h" |
| 12 #include "chrome/browser/safe_browsing/malware_details.h" | 12 #include "chrome/browser/safe_browsing/malware_details.h" |
| 13 #include "chrome/common/chrome_notification_types.h" | 13 #include "chrome/common/chrome_notification_types.h" |
| 14 #include "content/browser/browser_thread.h" | 14 #include "content/browser/browser_thread.h" |
| 15 #include "content/browser/renderer_host/render_view_host.h" | 15 #include "content/browser/renderer_host/render_view_host.h" |
| 16 #include "content/browser/tab_contents/navigation_entry.h" | 16 #include "content/browser/tab_contents/navigation_entry.h" |
| 17 #include "content/browser/tab_contents/tab_contents.h" | 17 #include "content/browser/tab_contents/tab_contents.h" |
| 18 #include "content/common/notification_service.h" | |
| 19 #include "content/public/browser/notification_details.h" | 18 #include "content/public/browser/notification_details.h" |
| 20 #include "content/public/browser/notification_source.h" | 19 #include "content/public/browser/notification_source.h" |
| 21 | 20 |
| 22 MalwareDetailsRedirectsCollector::MalwareDetailsRedirectsCollector( | 21 MalwareDetailsRedirectsCollector::MalwareDetailsRedirectsCollector( |
| 23 Profile* profile) | 22 Profile* profile) |
| 24 : profile_(profile), | 23 : profile_(profile), |
| 25 has_started_(false) { | 24 has_started_(false) { |
| 26 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 25 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 27 if (profile) { | 26 if (profile) { |
| 28 registrar_.Add(this, chrome::NOTIFICATION_PROFILE_DESTROYED, | 27 registrar_.Add(this, chrome::NOTIFICATION_PROFILE_DESTROYED, |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 | 125 |
| 127 void MalwareDetailsRedirectsCollector::Observe( | 126 void MalwareDetailsRedirectsCollector::Observe( |
| 128 int type, | 127 int type, |
| 129 const content::NotificationSource& source, | 128 const content::NotificationSource& source, |
| 130 const content::NotificationDetails& details) { | 129 const content::NotificationDetails& details) { |
| 131 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 130 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 132 DCHECK_EQ(type, chrome::NOTIFICATION_PROFILE_DESTROYED); | 131 DCHECK_EQ(type, chrome::NOTIFICATION_PROFILE_DESTROYED); |
| 133 DVLOG(1) << "Profile gone."; | 132 DVLOG(1) << "Profile gone."; |
| 134 profile_ = NULL; | 133 profile_ = NULL; |
| 135 } | 134 } |
| OLD | NEW |