summaryrefslogtreecommitdiffstats
path: root/chrome/browser/predictors/predictor_database_factory.cc
diff options
context:
space:
mode:
authorshishir@chromium.org <shishir@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-05-10 23:20:09 +0000
committershishir@chromium.org <shishir@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-05-10 23:20:09 +0000
commitabe52909b455d61287d4d615ca47fbb7822b9b01 (patch)
tree3411cf74e91b08f0721e5ca5df6456cbc230536e /chrome/browser/predictors/predictor_database_factory.cc
parent63b675bb73dc94a45c6049795cebd34ae0c66185 (diff)
downloadchromium_src-abe52909b455d61287d4d615ca47fbb7822b9b01.zip
chromium_src-abe52909b455d61287d4d615ca47fbb7822b9b01.tar.gz
chromium_src-abe52909b455d61287d4d615ca47fbb7822b9b01.tar.bz2
Refactoring AutocompleteActionPredictor Database.
BUG= TEST=Same as before Review URL: https://chromiumcodereview.appspot.com/10380041 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@136439 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/predictors/predictor_database_factory.cc')
-rw-r--r--chrome/browser/predictors/predictor_database_factory.cc39
1 files changed, 39 insertions, 0 deletions
diff --git a/chrome/browser/predictors/predictor_database_factory.cc b/chrome/browser/predictors/predictor_database_factory.cc
new file mode 100644
index 0000000..5e8e1a1
--- /dev/null
+++ b/chrome/browser/predictors/predictor_database_factory.cc
@@ -0,0 +1,39 @@
+// Copyright (c) 2012 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.
+
+#include "chrome/browser/predictors/predictor_database_factory.h"
+
+#include "base/bind.h"
+#include "chrome/browser/predictors/predictor_database.h"
+#include "chrome/browser/profiles/profile.h"
+#include "chrome/browser/profiles/profile_dependency_manager.h"
+#include "content/public/browser/browser_thread.h"
+
+namespace predictors {
+
+// static
+PredictorDatabase* PredictorDatabaseFactory::GetForProfile(Profile* profile) {
+ return static_cast<PredictorDatabase*>(
+ GetInstance()->GetServiceForProfile(profile, true));
+}
+
+// static
+PredictorDatabaseFactory* PredictorDatabaseFactory::GetInstance() {
+ return Singleton<PredictorDatabaseFactory>::get();
+}
+
+PredictorDatabaseFactory::PredictorDatabaseFactory()
+ : ProfileKeyedServiceFactory(
+ "PredictorDatabase", ProfileDependencyManager::GetInstance()) {
+}
+
+PredictorDatabaseFactory::~PredictorDatabaseFactory() {
+}
+
+ProfileKeyedService* PredictorDatabaseFactory::BuildServiceInstanceFor(
+ Profile* profile) const {
+ return new PredictorDatabase(profile);
+}
+
+} // namespace predictors