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

Unified Diff: chrome/browser/history/in_memory_history_backend.cc

Issue 830483005: Eliminate sending NOTIFICATION_HISTORY_KEYWORD_SEARCH_TERM_DELETED (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: updated 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 5076f24c7bf316494cf33a55c383a5dcad996832..1165d23b649276e710bdde195ee68b62be3f4fa6 100644
--- a/chrome/browser/history/in_memory_history_backend.cc
+++ b/chrome/browser/history/in_memory_history_backend.cc
@@ -60,8 +60,6 @@ void InMemoryHistoryBackend::AttachToHistoryService(
// We only want notifications for the associated profile.
content::Source<Profile> source(profile_);
registrar_.Add(this, chrome::NOTIFICATION_HISTORY_URLS_DELETED, source);
- registrar_.Add(
- this, chrome::NOTIFICATION_HISTORY_KEYWORD_SEARCH_TERM_DELETED, source);
}
void InMemoryHistoryBackend::DeleteAllSearchTermsForKeyword(
@@ -96,15 +94,19 @@ void InMemoryHistoryBackend::OnKeywordSearchTermUpdated(
db_->SetKeywordSearchTermsForURL(row.id(), keyword_id, term);
}
+void InMemoryHistoryBackend::OnKeywordSearchTermDeleted(
+ HistoryService* history_service,
+ URLID url_id) {
+ // For simplicity, this will not remove the corresponding URLRow, but this is
+ // okay, as the main database does not do so either.
+ db_->DeleteKeywordSearchTermForURL(url_id);
+}
+
void InMemoryHistoryBackend::Observe(
int type,
const content::NotificationSource& source,
const content::NotificationDetails& details) {
switch (type) {
- case chrome::NOTIFICATION_HISTORY_KEYWORD_SEARCH_TERM_DELETED:
- OnKeywordSearchTermDeleted(
- *content::Details<KeywordSearchDeletedDetails>(details).ptr());
- break;
case chrome::NOTIFICATION_HISTORY_URLS_DELETED:
OnURLsDeleted(*content::Details<URLsDeletedDetails>(details).ptr());
break;
@@ -145,11 +147,4 @@ void InMemoryHistoryBackend::OnURLsDeleted(const URLsDeletedDetails& details) {
}
}
-void InMemoryHistoryBackend::OnKeywordSearchTermDeleted(
- const KeywordSearchDeletedDetails& details) {
- // For simplicity, this will not remove the corresponding URLRow, but this is
- // okay, as the main database does not do so either.
- db_->DeleteKeywordSearchTermForURL(details.url_row_id);
-}
-
} // namespace history
« 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