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_SNIPPETS_NTP_SNIPPETS_SERVICE_FACTORY_H_ |
| 6 #define CHROME_BROWSER_NTP_SNIPPETS_NTP_SNIPPETS_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 class Profile; |
| 13 |
| 14 namespace base { |
| 15 template <typename T> |
| 16 struct DefaultSingletonTraits; |
| 17 } // namespace base |
| 18 |
| 19 namespace ntp_snippets { |
| 20 class NTPSnippetsService; |
| 21 } // namespace ntp_snippets |
| 22 |
| 23 // A factory to create NTPSnippetsService and associate them to its browser |
| 24 // context. |
| 25 class NTPSnippetsServiceFactory : public BrowserContextKeyedServiceFactory { |
| 26 public: |
| 27 static NTPSnippetsServiceFactory* GetInstance(); |
| 28 static ntp_snippets::NTPSnippetsService* GetForProfile(Profile* profile); |
| 29 |
| 30 private: |
| 31 friend struct base::DefaultSingletonTraits<NTPSnippetsServiceFactory>; |
| 32 |
| 33 NTPSnippetsServiceFactory(); |
| 34 ~NTPSnippetsServiceFactory() override; |
| 35 |
| 36 // BrowserStateKeyedServiceFactory implementation. |
| 37 KeyedService* BuildServiceInstanceFor( |
| 38 content::BrowserContext* context) const override; |
| 39 |
| 40 DISALLOW_COPY_AND_ASSIGN(NTPSnippetsServiceFactory); |
| 41 }; |
| 42 |
| 43 #endif // CHROME_BROWSER_NTP_SNIPPETS_NTP_SNIPPETS_SERVICE_FACTORY_H_ |
OLD | NEW |