Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2016 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_PREVIEWS_PREVIEWS_SERVICE_FACTORY_H_ | |
| 6 #define CHROME_BROWSER_PREVIEWS_PREVIEWS_SERVICE_FACTORY_H_ | |
| 7 | |
| 8 #include "base/memory/singleton.h" | |
|
Lei Zhang
2016/09/08 19:06:23
Please read the top of singleton.h. Can you use a
RyanSturm
2016/09/08 20:19:09
Done.
Lei Zhang
2016/09/08 21:31:56
Thanks. I realize someone implemented the first on
| |
| 9 #include "components/keyed_service/content/browser_context_keyed_service_factory .h" | |
| 10 | |
| 11 class Profile; | |
|
Lei Zhang
2016/09/08 19:06:23
Group this with the PreviewService fwrd decl.
RyanSturm
2016/09/08 20:19:09
Done.
| |
| 12 | |
| 13 namespace content { | |
| 14 class BrowserContext; | |
| 15 } | |
| 16 | |
| 17 class PreviewsService; | |
| 18 | |
| 19 // Singleton that owns all PreviewsServices and associates them with | |
| 20 // Profiles. | |
| 21 class PreviewsServiceFactory : public BrowserContextKeyedServiceFactory { | |
| 22 public: | |
| 23 // Gets the PreviewsService instance for |profile|. | |
| 24 static PreviewsService* GetForProfile(Profile* profile); | |
| 25 | |
| 26 // Gets the Singleton that owns all all PreviewsServices. | |
| 27 static PreviewsServiceFactory* GetInstance(); | |
| 28 | |
| 29 private: | |
| 30 friend struct base::DefaultSingletonTraits<PreviewsServiceFactory>; | |
| 31 | |
| 32 PreviewsServiceFactory(); | |
| 33 ~PreviewsServiceFactory() override; | |
| 34 | |
| 35 // BrowserContextKeyedServiceFactory: | |
| 36 KeyedService* BuildServiceInstanceFor( | |
| 37 content::BrowserContext* context) const override; | |
| 38 }; | |
| 39 | |
| 40 #endif // CHROME_BROWSER_PREVIEWS_PREVIEWS_SERVICE_FACTORY_H_ | |
| OLD | NEW |