start_page_service_factory.h revision 5d1f7b1de12d16ceb2c938c56701a3e8bfa558f7
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.
4
5#ifndef CHROME_BROWSER_UI_APP_LIST_START_PAGE_SERVICE_FACTORY_H_
6#define CHROME_BROWSER_UI_APP_LIST_START_PAGE_SERVICE_FACTORY_H_
7
8#include "base/memory/singleton.h"
9#include "components/browser_context_keyed_service/browser_context_keyed_service_factory.h"
10
11class Profile;
12
13namespace app_list {
14class StartPageService;
15
16// Singleton factory to create StartPageService.
17class StartPageServiceFactory : public BrowserContextKeyedServiceFactory {
18 public:
19  // Gets or creates the instance of StartPageService for |profile|.
20  static StartPageService* GetForProfile(Profile* profile);
21
22  // Gets the singleton instance of this factory.
23  static StartPageServiceFactory* GetInstance();
24
25 private:
26  friend struct DefaultSingletonTraits<StartPageServiceFactory>;
27
28  StartPageServiceFactory();
29  virtual ~StartPageServiceFactory();
30
31  // BrowserContextKeyedServiceFactory overrides:
32  virtual BrowserContextKeyedService* BuildServiceInstanceFor(
33      content::BrowserContext* context) const OVERRIDE;
34  virtual void RegisterProfilePrefs(
35      user_prefs::PrefRegistrySyncable* registry) OVERRIDE;
36
37  DISALLOW_COPY_AND_ASSIGN(StartPageServiceFactory);
38};
39
40}  // namespace app_list
41
42#endif  // CHROME_BROWSER_UI_APP_LIST_START_PAGE_SERVICE_FACTORY_H_
43