| 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 #include "chrome/browser/ui/search_engines/template_url_fetcher_ui_callbacks.h" | 5 #include "chrome/browser/ui/search_engines/template_url_fetcher_ui_callbacks.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/scoped_ptr.h" | 8 #include "base/scoped_ptr.h" |
| 9 #include "chrome/common/notification_source.h" | |
| 10 #include "chrome/common/notification_type.h" | |
| 11 #include "chrome/browser/search_engines/template_url.h" | 9 #include "chrome/browser/search_engines/template_url.h" |
| 12 #include "chrome/browser/ui/search_engines/search_engine_tab_helper.h" | 10 #include "chrome/browser/ui/search_engines/search_engine_tab_helper.h" |
| 13 #include "chrome/browser/ui/search_engines/search_engine_tab_helper_delegate.h" | 11 #include "chrome/browser/ui/search_engines/search_engine_tab_helper_delegate.h" |
| 14 #include "content/browser/tab_contents/tab_contents.h" | 12 #include "content/browser/tab_contents/tab_contents.h" |
| 13 #include "content/common/notification_source.h" |
| 14 #include "content/common/notification_type.h" |
| 15 | 15 |
| 16 TemplateURLFetcherUICallbacks::TemplateURLFetcherUICallbacks( | 16 TemplateURLFetcherUICallbacks::TemplateURLFetcherUICallbacks( |
| 17 SearchEngineTabHelper* tab_helper, | 17 SearchEngineTabHelper* tab_helper, |
| 18 TabContents* tab_contents) | 18 TabContents* tab_contents) |
| 19 : source_(tab_helper), | 19 : source_(tab_helper), |
| 20 tab_contents_(tab_contents) { | 20 tab_contents_(tab_contents) { |
| 21 registrar_.Add(this, | 21 registrar_.Add(this, |
| 22 NotificationType::TAB_CONTENTS_DESTROYED, | 22 NotificationType::TAB_CONTENTS_DESTROYED, |
| 23 Source<TabContents>(tab_contents_)); | 23 Source<TabContents>(tab_contents_)); |
| 24 } | 24 } |
| (...skipping 27 matching lines...) Expand all Loading... |
| 52 | 52 |
| 53 void TemplateURLFetcherUICallbacks::Observe( | 53 void TemplateURLFetcherUICallbacks::Observe( |
| 54 NotificationType type, | 54 NotificationType type, |
| 55 const NotificationSource& source, | 55 const NotificationSource& source, |
| 56 const NotificationDetails& details) { | 56 const NotificationDetails& details) { |
| 57 DCHECK(type == NotificationType::TAB_CONTENTS_DESTROYED); | 57 DCHECK(type == NotificationType::TAB_CONTENTS_DESTROYED); |
| 58 DCHECK(source == Source<TabContents>(tab_contents_)); | 58 DCHECK(source == Source<TabContents>(tab_contents_)); |
| 59 source_ = NULL; | 59 source_ = NULL; |
| 60 tab_contents_ = NULL; | 60 tab_contents_ = NULL; |
| 61 } | 61 } |
| OLD | NEW |