Index: chrome/browser/history/history_service.cc |
diff --git a/chrome/browser/history/history_service.cc b/chrome/browser/history/history_service.cc |
index 45e62ca6ca399d3d84ecde9062ff2d32b7a29236..61fb6b132639c801ccd186176a1b9b73e03294c8 100644 |
--- a/chrome/browser/history/history_service.cc |
+++ b/chrome/browser/history/history_service.cc |
@@ -881,6 +881,8 @@ void HistoryService::Cleanup() { |
return; |
} |
+ NotifyHistoryServiceBeingDeleted(); |
+ |
weak_ptr_factory_.InvalidateWeakPtrs(); |
// Unload the backend. |
@@ -1227,10 +1229,7 @@ void HistoryService::BroadcastNotificationsHelper( |
void HistoryService::OnDBLoaded() { |
DCHECK(thread_checker_.CalledOnValidThread()); |
backend_loaded_ = true; |
- content::NotificationService::current()->Notify( |
- chrome::NOTIFICATION_HISTORY_LOADED, |
- content::Source<Profile>(profile_), |
- content::Details<HistoryService>(this)); |
+ NotifyHistoryServiceLoaded(); |
} |
bool HistoryService::GetRowForURL(const GURL& url, history::URLRow* url_row) { |
@@ -1267,3 +1266,15 @@ void HistoryService::NotifyFaviconChanged( |
DCHECK(thread_checker_.CalledOnValidThread()); |
favicon_changed_callback_list_.Notify(changed_favicons); |
} |
+ |
+void HistoryService::NotifyHistoryServiceLoaded() { |
+ DCHECK(thread_checker_.CalledOnValidThread()); |
+ FOR_EACH_OBSERVER(history::HistoryServiceObserver, observers_, |
+ OnHistoryServiceLoaded(this)); |
+} |
+ |
+void HistoryService::NotifyHistoryServiceBeingDeleted() { |
+ DCHECK(thread_checker_.CalledOnValidThread()); |
+ FOR_EACH_OBSERVER(history::HistoryServiceObserver, observers_, |
+ HistoryServiceBeingDeleted(this)); |
+} |