Chromium Code Reviews| Index: chrome/browser/previews/previews_service_factory.h |
| diff --git a/chrome/browser/previews/previews_service_factory.h b/chrome/browser/previews/previews_service_factory.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..7a9d2ee37784c662c6ad060f87807c908b8fbd99 |
| --- /dev/null |
| +++ b/chrome/browser/previews/previews_service_factory.h |
| @@ -0,0 +1,40 @@ |
| +// Copyright 2016 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_PREVIEWS_PREVIEWS_SERVICE_FACTORY_H_ |
| +#define CHROME_BROWSER_PREVIEWS_PREVIEWS_SERVICE_FACTORY_H_ |
| + |
| +#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
|
| +#include "components/keyed_service/content/browser_context_keyed_service_factory.h" |
| + |
| +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.
|
| + |
| +namespace content { |
| +class BrowserContext; |
| +} |
| + |
| +class PreviewsService; |
| + |
| +// Singleton that owns all PreviewsServices and associates them with |
| +// Profiles. |
| +class PreviewsServiceFactory : public BrowserContextKeyedServiceFactory { |
| + public: |
| + // Gets the PreviewsService instance for |profile|. |
| + static PreviewsService* GetForProfile(Profile* profile); |
| + |
| + // Gets the Singleton that owns all all PreviewsServices. |
| + static PreviewsServiceFactory* GetInstance(); |
| + |
| + private: |
| + friend struct base::DefaultSingletonTraits<PreviewsServiceFactory>; |
| + |
| + PreviewsServiceFactory(); |
| + ~PreviewsServiceFactory() override; |
| + |
| + // BrowserContextKeyedServiceFactory: |
| + KeyedService* BuildServiceInstanceFor( |
| + content::BrowserContext* context) const override; |
| +}; |
| + |
| +#endif // CHROME_BROWSER_PREVIEWS_PREVIEWS_SERVICE_FACTORY_H_ |