Chromium Code Reviews| 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. |
|
Evan Stade
2012/04/24 19:02:43
is there a new format for license headers I'm not
Kyle Horimoto
2012/04/24 21:09:59
Oops, this was just the default license header tha
|
| +// 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; |
|
Evan Stade
2012/04/24 19:02:43
DISALLOW_COPY_AND_ASSIGN(ChromeURLDataManagerFacto
Kyle Horimoto
2012/04/24 21:09:59
Done. (And you're right!)
|
| +}; |
| + |
| +#endif // CHROME_BROWSER_UI_WEBUI_CHROME_URL_DATA_MANAGER_FACTORY_H_ |