Index: chrome/browser/android/provider/chrome_browser_provider.cc |
diff --git a/chrome/browser/android/provider/chrome_browser_provider.cc b/chrome/browser/android/provider/chrome_browser_provider.cc |
index a62de40182c8bfe7eb3e2e40a937cd158f0f7e72..730913ae934ddce581a1d19f5297218df1f76441 100644 |
--- a/chrome/browser/android/provider/chrome_browser_provider.cc |
+++ b/chrome/browser/android/provider/chrome_browser_provider.cc |
@@ -1172,8 +1172,6 @@ ChromeBrowserProvider::ChromeBrowserProvider(JNIEnv* env, jobject obj) |
bookmark_model_->AddObserver(this); |
history_service_observer_.Add( |
HistoryServiceFactory::GetForProfile(profile_, Profile::EXPLICIT_ACCESS)); |
- notification_registrar_.Add(this, chrome::NOTIFICATION_HISTORY_URLS_DELETED, |
- content::NotificationService::AllSources()); |
notification_registrar_.Add(this, |
chrome::NOTIFICATION_HISTORY_KEYWORD_SEARCH_TERM_UPDATED, |
content::NotificationService::AllSources()); |
@@ -1188,6 +1186,7 @@ ChromeBrowserProvider::~ChromeBrowserProvider() { |
} |
void ChromeBrowserProvider::Destroy(JNIEnv*, jobject) { |
+ history_service_observer_.RemoveAll(); |
delete this; |
} |
@@ -1623,14 +1622,17 @@ void ChromeBrowserProvider::OnURLVisited(HistoryService* history_service, |
OnHistoryChanged(); |
} |
+void ChromeBrowserProvider::OnURLsDeleted( |
+ HistoryService* history_service, |
+ const history::URLsDeletedDetails& deleted_details) { |
+ OnHistoryChanged(); |
+} |
+ |
void ChromeBrowserProvider::Observe( |
int type, |
const content::NotificationSource& source, |
const content::NotificationDetails& details) { |
- if (type == chrome::NOTIFICATION_HISTORY_URLS_DELETED) { |
- OnHistoryChanged(); |
- } else if (type == |
- chrome::NOTIFICATION_HISTORY_KEYWORD_SEARCH_TERM_UPDATED) { |
+ if (type == chrome::NOTIFICATION_HISTORY_KEYWORD_SEARCH_TERM_UPDATED) { |
sdefresne
2014/12/04 17:21:12
Since this is now the last notification that use c
nshaik
2014/12/07 09:34:49
Done.
|
JNIEnv* env = AttachCurrentThread(); |
ScopedJavaLocalRef<jobject> obj = weak_java_provider_.get(env); |
if (obj.is_null()) |