| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_UI_APP_LIST_START_PAGE_SERVICE_FACTORY_H_ | 5 #ifndef CHROME_BROWSER_UI_APP_LIST_START_PAGE_SERVICE_FACTORY_H_ |
| 6 #define CHROME_BROWSER_UI_APP_LIST_START_PAGE_SERVICE_FACTORY_H_ | 6 #define CHROME_BROWSER_UI_APP_LIST_START_PAGE_SERVICE_FACTORY_H_ |
| 7 | 7 |
| 8 #include "base/memory/singleton.h" | 8 #include "base/memory/singleton.h" |
| 9 #include "components/keyed_service/content/browser_context_keyed_service_factory
.h" | 9 #include "components/keyed_service/content/browser_context_keyed_service_factory
.h" |
| 10 | 10 |
| 11 class Profile; | 11 class Profile; |
| 12 | 12 |
| 13 namespace app_list { | 13 namespace app_list { |
| 14 class StartPageService; | 14 class StartPageService; |
| 15 | 15 |
| 16 // Singleton factory to create StartPageService. | 16 // Singleton factory to create StartPageService. |
| 17 class StartPageServiceFactory : public BrowserContextKeyedServiceFactory { | 17 class StartPageServiceFactory : public BrowserContextKeyedServiceFactory { |
| 18 public: | 18 public: |
| 19 // Gets or creates the instance of StartPageService for |profile|. May return | 19 // Gets or creates the instance of StartPageService for |profile|. May return |
| 20 // nullptr. | 20 // nullptr. |
| 21 static StartPageService* GetForProfile(Profile* profile); | 21 static StartPageService* GetForProfile(Profile* profile); |
| 22 | 22 |
| 23 // Gets the singleton instance of this factory. | 23 // Gets the singleton instance of this factory. |
| 24 static StartPageServiceFactory* GetInstance(); | 24 static StartPageServiceFactory* GetInstance(); |
| 25 | 25 |
| 26 private: | 26 private: |
| 27 friend struct DefaultSingletonTraits<StartPageServiceFactory>; | 27 friend struct base::DefaultSingletonTraits<StartPageServiceFactory>; |
| 28 | 28 |
| 29 StartPageServiceFactory(); | 29 StartPageServiceFactory(); |
| 30 ~StartPageServiceFactory() override; | 30 ~StartPageServiceFactory() override; |
| 31 | 31 |
| 32 // BrowserContextKeyedServiceFactory overrides: | 32 // BrowserContextKeyedServiceFactory overrides: |
| 33 KeyedService* BuildServiceInstanceFor( | 33 KeyedService* BuildServiceInstanceFor( |
| 34 content::BrowserContext* context) const override; | 34 content::BrowserContext* context) const override; |
| 35 content::BrowserContext* GetBrowserContextToUse( | 35 content::BrowserContext* GetBrowserContextToUse( |
| 36 content::BrowserContext* context) const override; | 36 content::BrowserContext* context) const override; |
| 37 | 37 |
| 38 DISALLOW_COPY_AND_ASSIGN(StartPageServiceFactory); | 38 DISALLOW_COPY_AND_ASSIGN(StartPageServiceFactory); |
| 39 }; | 39 }; |
| 40 | 40 |
| 41 } // namespace app_list | 41 } // namespace app_list |
| 42 | 42 |
| 43 #endif // CHROME_BROWSER_UI_APP_LIST_START_PAGE_SERVICE_FACTORY_H_ | 43 #endif // CHROME_BROWSER_UI_APP_LIST_START_PAGE_SERVICE_FACTORY_H_ |
| OLD | NEW |