Componentize AccountReconcilor.
[chromium-blink-merge.git] / chrome / browser / search / suggestions / suggestions_service_factory.h
blobb939c74a6bddbab8ccb8f7580e998732d4fe2162
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"
11 class Profile;
13 namespace suggestions {
15 class SuggestionsService;
17 // Singleton that owns all SuggestionsServices and associates them with
18 // Profiles.
19 class SuggestionsServiceFactory : public BrowserContextKeyedServiceFactory {
20 public:
21 // Returns the SuggestionsService for |profile|.
22 static suggestions::SuggestionsService* GetForProfile(Profile* profile);
24 static SuggestionsServiceFactory* GetInstance();
26 private:
27 friend struct DefaultSingletonTraits<SuggestionsServiceFactory>;
29 SuggestionsServiceFactory();
30 virtual ~SuggestionsServiceFactory();
32 // Overrides from BrowserContextKeyedServiceFactory:
33 virtual content::BrowserContext* GetBrowserContextToUse(
34 content::BrowserContext* context) const OVERRIDE;
35 virtual KeyedService* BuildServiceInstanceFor(
36 content::BrowserContext* profile) const OVERRIDE;
38 DISALLOW_COPY_AND_ASSIGN(SuggestionsServiceFactory);
41 } // namespace suggestions
43 #endif // CHROME_BROWSER_SEARCH_SUGGESTIONS_SUGGESTIONS_SERVICE_FACTORY_H_