OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROME_BROWSER_UI_WEBUI_CHROME_URL_DATA_MANAGER_FACTORY_H_ |
| 6 #define CHROME_BROWSER_UI_WEBUI_CHROME_URL_DATA_MANAGER_FACTORY_H_ |
| 7 #pragma once |
| 8 |
| 9 #include "base/compiler_specific.h" |
| 10 #include "base/memory/singleton.h" |
| 11 #include "chrome/browser/profiles/profile_keyed_service_factory.h" |
| 12 #include "chrome/browser/ui/webui/chrome_url_data_manager.h" |
| 13 |
| 14 // Singleton that owns all |ChromeURLDataManager|s and associates them with |
| 15 // |Profile|s. |
| 16 class ChromeURLDataManagerFactory : public ProfileKeyedServiceFactory { |
| 17 public: |
| 18 // Returns the appropriate |ChromeURLDataManager| for |profile|. Each |
| 19 // |Profile| has its own manager so that chrome:// URLs can be directed to |
| 20 // the correct UI. |
| 21 static ChromeURLDataManager* GetForProfile(Profile* profile); |
| 22 |
| 23 static ChromeURLDataManagerFactory* GetInstance(); |
| 24 |
| 25 private: |
| 26 friend struct DefaultSingletonTraits<ChromeURLDataManagerFactory>; |
| 27 |
| 28 ChromeURLDataManagerFactory(); |
| 29 virtual ~ChromeURLDataManagerFactory(); |
| 30 |
| 31 // ProfileKeyedServiceFactory: |
| 32 virtual ProfileKeyedService* BuildServiceInstanceFor( |
| 33 Profile* profile) const OVERRIDE; |
| 34 virtual bool ServiceHasOwnInstanceInIncognito() OVERRIDE; |
| 35 |
| 36 DISALLOW_COPY_AND_ASSIGN(ChromeURLDataManagerFactory); |
| 37 }; |
| 38 |
| 39 #endif // CHROME_BROWSER_UI_WEBUI_CHROME_URL_DATA_MANAGER_FACTORY_H_ |
OLD | NEW |