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

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: update unittest Created 5 years, 11 months 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 f8c2147759451b9bb86650fada0261810bbcc3c5..3ac342f23acca04b1284778201344b113a685a54 100644
--- a/chrome/browser/android/provider/chrome_browser_provider.cc
+++ b/chrome/browser/android/provider/chrome_browser_provider.cc
@@ -1177,9 +1177,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())
@@ -1627,18 +1624,22 @@ void ChromeBrowserProvider::OnURLVisited(HistoryService* history_service,
OnHistoryChanged();
}
+void ChromeBrowserProvider::OnKeywordSearchTermUpdated(
+ HistoryService* history_service,
+ const history::URLRow& row,
+ history::KeywordID keyword_id,
+ const base::string16& term) {
+ JNIEnv* env = AttachCurrentThread();
+ ScopedJavaLocalRef<jobject> obj = weak_java_provider_.get(env);
+ if (obj.is_null())
+ return;
+ Java_ChromeBrowserProvider_onSearchTermChanged(env, obj.obj());
+}
+
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) {
- JNIEnv* env = AttachCurrentThread();
- ScopedJavaLocalRef<jobject> obj = weak_java_provider_.get(env);
- if (obj.is_null())
- return;
- Java_ChromeBrowserProvider_onSearchTermChanged(env, obj.obj());
- }
+ DCHECK_EQ(type, chrome::NOTIFICATION_HISTORY_URLS_DELETED);
+ OnHistoryChanged();
}
« no previous file with comments | « chrome/browser/android/provider/chrome_browser_provider.h ('k') | chrome/browser/chrome_notification_types.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698