Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(164)

Unified Diff: chrome/browser/android/provider/chrome_browser_provider.cc

Issue 773103004: Remove NOTIFICATION_HISTORY_URLS_DELETED (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed local variables in tests Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..1f049ff48b596e0bee53e8a5fc412b3dbb1b8fa5 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,18 +1622,22 @@ void ChromeBrowserProvider::OnURLVisited(HistoryService* history_service,
OnHistoryChanged();
}
+void ChromeBrowserProvider::OnURLsDeleted(HistoryService* history_service,
+ bool all_history,
+ bool expired,
+ const URLRows& deleted_rows,
+ const std::set<GURL>& favicon_urls) {
+ 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) {
+ DCHECK_EQ(type, chrome::NOTIFICATION_HISTORY_KEYWORD_SEARCH_TERM_UPDATED);
JNIEnv* env = AttachCurrentThread();
ScopedJavaLocalRef<jobject> obj = weak_java_provider_.get(env);
if (obj.is_null())
return;
Java_ChromeBrowserProvider_onSearchTermChanged(env, obj.obj());
- }
}

Powered by Google App Engine
This is Rietveld 408576698