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 CHROME_BROWSER_SEARCH_SUGGESTIONS_SUGGESTIONS_SERVICE_FACTORY_H_
6 #define CHROME_BROWSER_SEARCH_SUGGESTIONS_SUGGESTIONS_SERVICE_FACTORY_H_
8 #include "base/memory/singleton.h"
9 #include "components/keyed_service/content/browser_context_keyed_service_factory.h"
13 namespace suggestions
{
15 class SuggestionsService
;
17 // Singleton that owns all SuggestionsServices and associates them with
19 class SuggestionsServiceFactory
: public BrowserContextKeyedServiceFactory
{
21 // Returns the SuggestionsService for |profile|.
22 static suggestions::SuggestionsService
* GetForProfile(Profile
* profile
);
24 static SuggestionsServiceFactory
* GetInstance();
27 friend struct base::DefaultSingletonTraits
<SuggestionsServiceFactory
>;
29 SuggestionsServiceFactory();
30 ~SuggestionsServiceFactory() override
;
32 // Overrides from BrowserContextKeyedServiceFactory:
33 KeyedService
* BuildServiceInstanceFor(
34 content::BrowserContext
* profile
) const override
;
35 void RegisterProfilePrefs(
36 user_prefs::PrefRegistrySyncable
* registry
) override
;
38 DISALLOW_COPY_AND_ASSIGN(SuggestionsServiceFactory
);
41 } // namespace suggestions
43 #endif // CHROME_BROWSER_SEARCH_SUGGESTIONS_SUGGESTIONS_SERVICE_FACTORY_H_