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

Unified Diff: chrome/browser/ui/webui/chrome_url_data_manager_factory.cc

Issue 10196004: Changed ChromeURLDataManager to a ProfileKeyedService and made a Factory for it. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Made ChromeURLDataManager's destructor virtual Created 8 years, 8 months 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/ui/webui/chrome_url_data_manager_factory.cc
diff --git a/chrome/browser/ui/webui/chrome_url_data_manager_factory.cc b/chrome/browser/ui/webui/chrome_url_data_manager_factory.cc
new file mode 100644
index 0000000000000000000000000000000000000000..75951a6ede03e9b11a0cf42325436348565a3a64
--- /dev/null
+++ b/chrome/browser/ui/webui/chrome_url_data_manager_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/ui/webui/chrome_url_data_manager_factory.h"
+
+#include "chrome/browser/profiles/profile.h"
+#include "chrome/browser/profiles/profile_dependency_manager.h"
+#include "chrome/browser/profiles/profile_keyed_service.h"
+
+// static
+ChromeURLDataManager* ChromeURLDataManagerFactory::GetForProfile(
+ Profile* profile) {
+ return static_cast<ChromeURLDataManager*>(
+ GetInstance()->GetServiceForProfile(profile, true));
+}
+
+// static
+ChromeURLDataManagerFactory* ChromeURLDataManagerFactory::GetInstance() {
+ return Singleton<ChromeURLDataManagerFactory>::get();
+}
+
+ChromeURLDataManagerFactory::ChromeURLDataManagerFactory()
+ : ProfileKeyedServiceFactory("ChromeURLDataManager",
+ ProfileDependencyManager::GetInstance()){
+}
+
+ChromeURLDataManagerFactory::~ChromeURLDataManagerFactory() {
+}
+
+ProfileKeyedService* ChromeURLDataManagerFactory::BuildServiceInstanceFor(
+ Profile* profile) const {
+ return new ChromeURLDataManager(
+ profile->GetChromeURLDataManagerBackendGetter());
+}
+
+bool ChromeURLDataManagerFactory::ServiceHasOwnInstanceInIncognito() {
+ return true;
+}

Powered by Google App Engine
This is Rietveld 408576698