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

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

Issue 573553004: Eliminate NOTIFICATION_HISTORY_LOADED notification (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Clean up of code in ResourcePrefetchPredictor Created 6 years, 1 month 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.h
diff --git a/chrome/browser/predictors/autocomplete_action_predictor.h b/chrome/browser/predictors/autocomplete_action_predictor.h
index e75cb082e189435082c1ff9cbdb99a689d53b643..af378281f0b74d43c4b0ba1a58560be0e5035cb4 100644
--- a/chrome/browser/predictors/autocomplete_action_predictor.h
+++ b/chrome/browser/predictors/autocomplete_action_predictor.h
@@ -11,8 +11,10 @@
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "base/memory/weak_ptr.h"
+#include "base/scoped_observer.h"
#include "base/strings/string16.h"
#include "chrome/browser/predictors/autocomplete_action_predictor_table.h"
+#include "components/history/core/browser/history_service_observer.h"
#include "components/history/core/browser/history_types.h"
#include "components/keyed_service/core/keyed_service.h"
#include "content/public/browser/navigation_controller.h"
@@ -61,6 +63,7 @@ namespace predictors {
class AutocompleteActionPredictor
: public KeyedService,
public content::NotificationObserver,
+ public history::HistoryServiceObserver,
public base::SupportsWeakPtr<AutocompleteActionPredictor> {
public:
enum Action {
@@ -112,6 +115,12 @@ class AutocompleteActionPredictor
// abandoned.
bool IsPrerenderAbandonedForTesting();
+ // KeyedService:
+ void Shutdown() override;
+
+ // history::HistoryServiceObserver:
+ void OnHistoryServiceLoaded(HistoryService* history_service) override;
+
private:
friend class AutocompleteActionPredictorTest;
friend class ::PredictorsHandler;
@@ -246,6 +255,9 @@ class AutocompleteActionPredictor
bool initialized_;
+ ScopedObserver<HistoryService, HistoryServiceObserver>
+ history_service_observer_;
+
DISALLOW_COPY_AND_ASSIGN(AutocompleteActionPredictor);
};

Powered by Google App Engine
This is Rietveld 408576698