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

Unified Diff: chrome/browser/autocomplete/network_action_predictor_factory.h

Issue 8872036: Profiles: Move NetworkActionPredictor to the ProfileKeyedService framework. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Add comment as reminder Created 9 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/autocomplete/network_action_predictor_factory.h
diff --git a/chrome/browser/autocomplete/network_action_predictor_factory.h b/chrome/browser/autocomplete/network_action_predictor_factory.h
new file mode 100644
index 0000000000000000000000000000000000000000..0f7842b6353e40d0705024675d19f1dca662b4c2
--- /dev/null
+++ b/chrome/browser/autocomplete/network_action_predictor_factory.h
@@ -0,0 +1,37 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_AUTOCOMPLETE_NETWORK_ACTION_PREDICTOR_FACTORY_H_
+#define CHROME_BROWSER_AUTOCOMPLETE_NETWORK_ACTION_PREDICTOR_FACTORY_H_
+#pragma once
+
+#include "base/basictypes.h"
+#include "base/memory/singleton.h"
+#include "chrome/browser/profiles/profile_keyed_service_factory.h"
+
+class NetworkActionPredictor;
+
+// Singleton that owns all NetworkActionPredictors and associates them with
+// Profiles. Listens for the Profile's destruction notification and cleans up
+// the associated NetworkActionPredictor.
+class NetworkActionPredictorFactory : public ProfileKeyedServiceFactory {
+ public:
+ static NetworkActionPredictor* GetForProfile(Profile* profile);
+
+ static NetworkActionPredictorFactory* GetInstance();
+
+ private:
+ friend struct DefaultSingletonTraits<NetworkActionPredictorFactory>;
+
+ NetworkActionPredictorFactory();
+ virtual ~NetworkActionPredictorFactory();
+
+ // ProfileKeyedServiceFactory:
+ virtual ProfileKeyedService* BuildServiceInstanceFor(
+ Profile* profile) const OVERRIDE;
+
+ DISALLOW_COPY_AND_ASSIGN(NetworkActionPredictorFactory);
+};
+
+#endif // CHROME_BROWSER_AUTOCOMPLETE_NETWORK_ACTION_PREDICTOR_FACTORY_H_

Powered by Google App Engine
This is Rietveld 408576698