| OLD | NEW | 
|   1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |   1 // Copyright (c) 2011 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_SESSIONS_TAB_RESTORE_SERVICE_FACTORY_H_ |   5 #ifndef CHROME_BROWSER_SESSIONS_TAB_RESTORE_SERVICE_FACTORY_H_ | 
|   6 #define CHROME_BROWSER_SESSIONS_TAB_RESTORE_SERVICE_FACTORY_H_ |   6 #define CHROME_BROWSER_SESSIONS_TAB_RESTORE_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; | 
 |  12  | 
 |  13 namespace sessions { | 
|  11 class TabRestoreService; |  14 class TabRestoreService; | 
|  12 class Profile; |  15 } | 
|  13  |  16  | 
|  14 // Singleton that owns all TabRestoreServices and associates them with |  17 // Singleton that owns all TabRestoreServices and associates them with | 
|  15 // Profiles. Listens for the Profile's destruction notification and cleans up |  18 // Profiles. Listens for the Profile's destruction notification and cleans up | 
|  16 // the associated TabRestoreService. |  19 // the associated TabRestoreService. | 
|  17 class TabRestoreServiceFactory : public BrowserContextKeyedServiceFactory { |  20 class TabRestoreServiceFactory : public BrowserContextKeyedServiceFactory { | 
|  18  public: |  21  public: | 
|  19   static TabRestoreService* GetForProfile(Profile* profile); |  22   static sessions::TabRestoreService* GetForProfile(Profile* profile); | 
|  20  |  23  | 
|  21   // Variant of GetForProfile() that returns NULL if TabRestoreService does not |  24   // Variant of GetForProfile() that returns NULL if TabRestoreService does not | 
|  22   // exist. |  25   // exist. | 
|  23   static TabRestoreService* GetForProfileIfExisting(Profile* profile); |  26   static sessions::TabRestoreService* GetForProfileIfExisting(Profile* profile); | 
|  24  |  27  | 
|  25   static void ResetForProfile(Profile* profile); |  28   static void ResetForProfile(Profile* profile); | 
|  26  |  29  | 
|  27   static TabRestoreServiceFactory* GetInstance(); |  30   static TabRestoreServiceFactory* GetInstance(); | 
|  28  |  31  | 
|  29  private: |  32  private: | 
|  30   friend struct base::DefaultSingletonTraits<TabRestoreServiceFactory>; |  33   friend struct base::DefaultSingletonTraits<TabRestoreServiceFactory>; | 
|  31  |  34  | 
|  32   TabRestoreServiceFactory(); |  35   TabRestoreServiceFactory(); | 
|  33   ~TabRestoreServiceFactory() override; |  36   ~TabRestoreServiceFactory() override; | 
|  34  |  37  | 
|  35   // BrowserContextKeyedServiceFactory: |  38   // BrowserContextKeyedServiceFactory: | 
|  36   KeyedService* BuildServiceInstanceFor( |  39   KeyedService* BuildServiceInstanceFor( | 
|  37       content::BrowserContext* browser_context) const override; |  40       content::BrowserContext* browser_context) const override; | 
|  38   bool ServiceIsNULLWhileTesting() const override; |  41   bool ServiceIsNULLWhileTesting() const override; | 
|  39 }; |  42 }; | 
|  40  |  43  | 
|  41 #endif  // CHROME_BROWSER_SESSIONS_TAB_RESTORE_SERVICE_FACTORY_H_ |  44 #endif  // CHROME_BROWSER_SESSIONS_TAB_RESTORE_SERVICE_FACTORY_H_ | 
| OLD | NEW |