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

Unified Diff: chrome/browser/predictors/autocomplete_action_predictor.cc

Issue 773103004: Remove NOTIFICATION_HISTORY_URLS_DELETED (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove NotificationObserver from InMemoryURLIndex 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/predictors/autocomplete_action_predictor.cc
diff --git a/chrome/browser/predictors/autocomplete_action_predictor.cc b/chrome/browser/predictors/autocomplete_action_predictor.cc
index e13c0309904ba00c181d090ab2191bc6740a86f2..117d897d666bfc73fc6ce19bff3ad89172b0ff16 100644
--- a/chrome/browser/predictors/autocomplete_action_predictor.cc
+++ b/chrome/browser/predictors/autocomplete_action_predictor.cc
@@ -236,19 +236,6 @@ void AutocompleteActionPredictor::Observe(
content::NOTIFICATION_LOAD_COMPLETED_MAIN_FRAME,
content::NotificationService::AllSources());
break;
-
- case chrome::NOTIFICATION_HISTORY_URLS_DELETED: {
- DCHECK(initialized_);
- const content::Details<const history::URLsDeletedDetails>
- urls_deleted_details =
- content::Details<const history::URLsDeletedDetails>(details);
- if (urls_deleted_details->all_history)
- DeleteAllRows();
- else
- DeleteRowsWithURLs(urls_deleted_details->rows);
- break;
- }
-
case chrome::NOTIFICATION_OMNIBOX_OPENED_URL: {
DCHECK(initialized_);
@@ -562,8 +549,6 @@ void AutocompleteActionPredictor::FinishInitialization() {
// opens the non-incognito history (and lets users delete from there).
notification_registrar_.Add(this, chrome::NOTIFICATION_OMNIBOX_OPENED_URL,
content::Source<Profile>(profile_));
- notification_registrar_.Add(this, chrome::NOTIFICATION_HISTORY_URLS_DELETED,
- content::Source<Profile>(profile_->GetOriginalProfile()));
initialized_ = true;
}
@@ -599,6 +584,16 @@ void AutocompleteActionPredictor::Shutdown() {
history_service_observer_.RemoveAll();
}
+void AutocompleteActionPredictor::OnURLsDeleted(
+ HistoryService* history_service,
+ const history::URLsDeletedDetails& deleted_details) {
+ DCHECK(initialized_);
+ if (deleted_details.all_history)
+ DeleteAllRows();
+ else
+ DeleteRowsWithURLs(deleted_details.rows);
+}
+
void AutocompleteActionPredictor::OnHistoryServiceLoaded(
HistoryService* history_service) {
TryDeleteOldEntries(history_service);

Powered by Google App Engine
This is Rietveld 408576698