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

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

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.h
diff --git a/chrome/browser/ui/webui/chrome_url_data_manager_factory.h b/chrome/browser/ui/webui/chrome_url_data_manager_factory.h
new file mode 100644
index 0000000000000000000000000000000000000000..cf918aa7ff5c118b8bc1a0c8943685e899eee67a
--- /dev/null
+++ b/chrome/browser/ui/webui/chrome_url_data_manager_factory.h
@@ -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.
+
+#ifndef CHROME_BROWSER_UI_WEBUI_CHROME_URL_DATA_MANAGER_FACTORY_H_
+#define CHROME_BROWSER_UI_WEBUI_CHROME_URL_DATA_MANAGER_FACTORY_H_
+#pragma once
+
+#include "base/compiler_specific.h"
+#include "base/memory/singleton.h"
+#include "chrome/browser/profiles/profile_keyed_service_factory.h"
+#include "chrome/browser/ui/webui/chrome_url_data_manager.h"
+
+// Singleton that owns all |ChromeURLDataManager|s and associates them with
+// |Profile|s.
+class ChromeURLDataManagerFactory : public ProfileKeyedServiceFactory {
+ public:
+ // Returns the appropriate |ChromeURLDataManager| for |profile|. Each
+ // |Profile| has its own manager so that chrome:// URLs can be directed to
+ // the correct UI.
+ static ChromeURLDataManager* GetForProfile(Profile* profile);
+
+ static ChromeURLDataManagerFactory* GetInstance();
+
+ private:
+ friend struct DefaultSingletonTraits<ChromeURLDataManagerFactory>;
+
+ ChromeURLDataManagerFactory();
+ virtual ~ChromeURLDataManagerFactory();
+
+ // ProfileKeyedServiceFactory:
+ virtual ProfileKeyedService* BuildServiceInstanceFor(
+ Profile* profile) const OVERRIDE;
+ virtual bool ServiceHasOwnInstanceInIncognito() OVERRIDE;
+
+ DISALLOW_COPY_AND_ASSIGN(ChromeURLDataManagerFactory);
+};
+
+#endif // CHROME_BROWSER_UI_WEBUI_CHROME_URL_DATA_MANAGER_FACTORY_H_
« no previous file with comments | « chrome/browser/ui/webui/chrome_url_data_manager.cc ('k') | chrome/browser/ui/webui/chrome_url_data_manager_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698