Chromium Code Reviews| 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..8d207c67ee15dab0dcd2eaccc1ac69c17f40d697 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,19 @@ void InMemoryHistoryBackend::OnURLsModified(HistoryService* history_service, |
| } |
| } |
| +void InMemoryHistoryBackend::OnKeywordSearchTermUpdated( |
| + HistoryService* history_service, |
| + const URLRow& row, |
| + KeywordID keyword_id, |
| + const base::string16& term) { |
| + OnKeywordSearchTermUpdated(row, 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()); |
| @@ -142,11 +144,12 @@ void InMemoryHistoryBackend::OnURLsDeleted(const URLsDeletedDetails& details) { |
| } |
| void InMemoryHistoryBackend::OnKeywordSearchTermUpdated( |
|
sdefresne
2014/12/29 13:29:29
I'd suggest removing this method and inlining the
Abhishek
2014/12/29 14:12:40
I also felt the same because its creating confusio
|
| - const KeywordSearchUpdatedDetails& details) { |
| - DCHECK(details.url_row.id()); |
| - db_->InsertOrUpdateURLRowByID(details.url_row); |
| - db_->SetKeywordSearchTermsForURL( |
| - details.url_row.id(), details.keyword_id, details.term); |
| + 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::OnKeywordSearchTermDeleted( |