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_SUGGESTIONS_NTP_SUGGESTIONS_SERVICE_FACTORY_H_ | |
6 #define CHROME_BROWSER_NTP_SUGGESTIONS_NTP_SUGGESTIONS_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_suggestions { | |
18 class NTPSuggestionsService; | |
19 } // namespace ntp_suggestions | |
20 | |
21 // A factory to create NTPSuggestionsService and associate them to its browser | |
22 // context. | |
23 class NTPSuggestionsServiceFactory : public BrowserContextKeyedServiceFactory { | |
24 public: | |
25 static NTPSuggestionsServiceFactory* GetInstance(); | |
26 static ntp_suggestions::NTPSuggestionsService* GetForBrowserContext( | |
sdefresne
2015/11/17 13:57:29
Usually the BrowserContextKeyedServiceFactory do d
noyau (Ping after 24h)
2015/11/17 17:00:33
Done.
| |
27 content::BrowserContext* context); | |
28 | |
29 private: | |
30 friend struct base::DefaultSingletonTraits<NTPSuggestionsServiceFactory>; | |
31 | |
32 NTPSuggestionsServiceFactory(); | |
33 ~NTPSuggestionsServiceFactory() 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(NTPSuggestionsServiceFactory); | |
42 }; | |
43 | |
44 #endif // CHROME_BROWSER_NTP_SUGGESTIONS_NTP_SUGGESTIONS_SERVICE_FACTORY_H_ | |
OLD | NEW |