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

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

Issue 808123003: Eliminate sending NOTIFICATION_HISTORY_KEYWORD_SEARCH_TERM_UPDATED (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Updated patch for android port 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 681aa8bd05c02bbd3a3677518cd6d83da88f4a65..fe8c377b4edf0f450e57d2cd19cd629b4d311007 100644
--- a/chrome/browser/android/provider/chrome_browser_provider.cc
+++ b/chrome/browser/android/provider/chrome_browser_provider.cc
@@ -1176,9 +1176,6 @@ ChromeBrowserProvider::ChromeBrowserProvider(JNIEnv* env, jobject obj)
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());
TemplateURLService* template_service =
TemplateURLServiceFactory::GetForProfile(profile_);
if (!template_service->loaded())
@@ -1626,18 +1623,27 @@ void ChromeBrowserProvider::OnURLVisited(HistoryService* history_service,
OnHistoryChanged();
}
+void ChromeBrowserProvider::OnSearchTermUpdated() {
+ JNIEnv* env = AttachCurrentThread();
+ ScopedJavaLocalRef<jobject> obj = weak_java_provider_.get(env);
+ if (obj.is_null())
+ return;
+ Java_ChromeBrowserProvider_onSearchTermChanged(env, obj.obj());
+}
+
+void ChromeBrowserProvider::HistoryKeywordSearchTermUpdated(
+ HistoryService* history_service,
+ const history::URLRow& row,
+ history::KeywordID keyword_id,
+ const base::string16& term) {
+ OnSearchTermUpdated();
+}
+
void ChromeBrowserProvider::Observe(
int type,
const content::NotificationSource& source,
const content::NotificationDetails& details) {
if (type == chrome::NOTIFICATION_HISTORY_URLS_DELETED) {
sdefresne 2014/12/24 09:03:43 DCHECK_EQ(type, chrome::NOTIFICATION_HISTORY_URLS_
sdefresne 2014/12/24 09:03:43 DCHECK_EQ(type, chrome::NOTIFICATION_HISTORY_URLS_
Abhishek 2014/12/24 19:39:40 Done.
OnHistoryChanged();
- } else if (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