OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2015 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_NTP_CONTENT_NTP_CONTENT_SERVICE_FACTORY_H_ | |
6 #define CHROME_BROWSER_NTP_CONTENT_NTP_CONTENT_SERVICE_FACTORY_H_ | |
7 | |
8 #include "base/macros.h" | |
9 #include "base/memory/scoped_ptr.h" | |
10 #include "components/keyed_service/content/browser_context_keyed_service_factory .h" | |
11 | |
12 namespace base { | |
13 template <typename T> | |
14 struct DefaultSingletonTraits; | |
15 } // namespace base | |
16 | |
17 namespace ntp_content { | |
blundell
2015/11/16 16:00:53
nit: Don't use a namespace in //chrome.
noyau (Ping after 24h)
2015/11/17 10:36:10
Done.
| |
18 | |
19 class NTPContentService; | |
20 | |
21 // A factory to create NTPContentService and associate them to its browser | |
22 // context. | |
23 class NTPContentServiceFactory : public BrowserContextKeyedServiceFactory { | |
24 public: | |
25 static NTPContentServiceFactory* GetInstance(); | |
26 static NTPContentService* GetForBrowserContext( | |
27 content::BrowserContext* context); | |
28 | |
29 private: | |
30 friend struct base::DefaultSingletonTraits<NTPContentServiceFactory>; | |
31 | |
32 NTPContentServiceFactory(); | |
33 ~NTPContentServiceFactory() override; | |
34 | |
35 // BrowserStateKeyedServiceFactory implementation. | |
36 KeyedService* BuildServiceInstanceFor( | |
37 content::BrowserContext* context) const override; | |
38 content::BrowserContext* GetBrowserContextToUse( | |
39 content::BrowserContext* context) const override; | |
40 | |
41 DISALLOW_COPY_AND_ASSIGN(NTPContentServiceFactory); | |
42 }; | |
43 | |
44 } // namespace ntp_content | |
45 | |
46 #endif // CHROME_BROWSER_NTP_CONTENT_NTP_CONTENT_SERVICE_FACTORY_H_ | |
OLD | NEW |