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

Unified Diff: chrome/browser/history/in_memory_history_backend.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/history/in_memory_history_backend.cc
diff --git a/chrome/browser/history/in_memory_history_backend.cc b/chrome/browser/history/in_memory_history_backend.cc
index 1660e00e90ab8d3996cca80b8745cb4b9fe618f7..5076f24c7bf316494cf33a55c383a5dcad996832 100644
--- a/chrome/browser/history/in_memory_history_backend.cc
+++ b/chrome/browser/history/in_memory_history_backend.cc
@@ -61,8 +61,6 @@ void InMemoryHistoryBackend::AttachToHistoryService(
content::Source<Profile> source(profile_);
registrar_.Add(this, chrome::NOTIFICATION_HISTORY_URLS_DELETED, source);
registrar_.Add(
- this, chrome::NOTIFICATION_HISTORY_KEYWORD_SEARCH_TERM_UPDATED, source);
- registrar_.Add(
this, chrome::NOTIFICATION_HISTORY_KEYWORD_SEARCH_TERM_DELETED, source);
}
@@ -88,15 +86,21 @@ void InMemoryHistoryBackend::OnURLsModified(HistoryService* history_service,
}
}
+void InMemoryHistoryBackend::OnKeywordSearchTermUpdated(
+ HistoryService* history_service,
+ const URLRow& row,
+ KeywordID keyword_id,
+ const base::string16& term) {
+ DCHECK(row.id());
+ db_->InsertOrUpdateURLRowByID(row);
+ db_->SetKeywordSearchTermsForURL(row.id(), keyword_id, term);
+}
+
void InMemoryHistoryBackend::Observe(
int type,
const content::NotificationSource& source,
const content::NotificationDetails& details) {
switch (type) {
- case chrome::NOTIFICATION_HISTORY_KEYWORD_SEARCH_TERM_UPDATED:
- OnKeywordSearchTermUpdated(
- *content::Details<KeywordSearchUpdatedDetails>(details).ptr());
- break;
case chrome::NOTIFICATION_HISTORY_KEYWORD_SEARCH_TERM_DELETED:
OnKeywordSearchTermDeleted(
*content::Details<KeywordSearchDeletedDetails>(details).ptr());
@@ -141,14 +145,6 @@ void InMemoryHistoryBackend::OnURLsDeleted(const URLsDeletedDetails& details) {
}
}
-void InMemoryHistoryBackend::OnKeywordSearchTermUpdated(
- const KeywordSearchUpdatedDetails& details) {
- DCHECK(details.url_row.id());
- db_->InsertOrUpdateURLRowByID(details.url_row);
- db_->SetKeywordSearchTermsForURL(
- details.url_row.id(), details.keyword_id, details.term);
-}
-
void InMemoryHistoryBackend::OnKeywordSearchTermDeleted(
const KeywordSearchDeletedDetails& details) {
// For simplicity, this will not remove the corresponding URLRow, but this is
« no previous file with comments | « chrome/browser/history/in_memory_history_backend.h ('k') | components/history/core/browser/history_service_observer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698