start_page_service_factory.h revision a1401311d1ab56c4ed0a474bd38c108f75cb0cd9
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/keyed_service/content/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 KeyedService* BuildServiceInstanceFor(
33      content::BrowserContext* context) const OVERRIDE;
34
35  DISALLOW_COPY_AND_ASSIGN(StartPageServiceFactory);
36};
37
38}  // namespace app_list
39
40#endif  // CHROME_BROWSER_UI_APP_LIST_START_PAGE_SERVICE_FACTORY_H_
41