1 // Copyright 2014 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.
5 #ifndef IOS_CHROME_BROWSER_SUGGESTIONS_SUGGESTIONS_SERVICE_FACTORY_H_
6 #define IOS_CHROME_BROWSER_SUGGESTIONS_SUGGESTIONS_SERVICE_FACTORY_H_
8 #include "base/macros.h"
9 #include "components/keyed_service/ios/browser_state_keyed_service_factory.h"
12 struct DefaultSingletonTraits
;
18 namespace suggestions
{
20 class SuggestionsService
;
22 // Singleton that owns all SuggestionsServices and associates them with
24 class SuggestionsServiceFactory
: public BrowserStateKeyedServiceFactory
{
26 static SuggestionsServiceFactory
* GetInstance();
28 // Returns the SuggestionsService for |browser_state|.
29 static SuggestionsService
* GetForBrowserState(
30 web::BrowserState
* browser_state
);
33 friend struct DefaultSingletonTraits
<SuggestionsServiceFactory
>;
35 SuggestionsServiceFactory();
36 ~SuggestionsServiceFactory() override
;
38 // BrowserStateKeyedServiceFactory:
39 KeyedService
* BuildServiceInstanceFor(
40 web::BrowserState
* browser_state
) const override
;
41 void RegisterProfilePrefs(
42 user_prefs::PrefRegistrySyncable
* registry
) override
;
44 DISALLOW_COPY_AND_ASSIGN(SuggestionsServiceFactory
);
47 } // namespace suggestions
49 #endif // IOS_CHROME_BROWSER_SUGGESTIONS_SUGGESTIONS_SERVICE_FACTORY_H_