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

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: 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..96323498b97b622008047a75b36a7119bf0d57f3
--- /dev/null
+++ b/chrome/browser/ui/webui/chrome_url_data_manager_factory.h
@@ -0,0 +1,36 @@
+// Copyright 2012 Google Inc. All Rights Reserved.
+// Author: khorimoto@google.com (Kyle Horimoto)
+
+#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;
+};
+
+#endif // CHROME_BROWSER_UI_WEBUI_CHROME_URL_DATA_MANAGER_FACTORY_H_

Powered by Google App Engine
This is Rietveld 408576698