BookmarkManager: Fix 'new folder text field size changes on clicking it' issue.
[chromium-blink-merge.git] / chrome / browser / sessions / tab_restore_service_factory.h
blob20b82ccf397bea8c37cf86b15590fd7e9d0d7f50
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
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_SESSIONS_TAB_RESTORE_SERVICE_FACTORY_H_
6 #define CHROME_BROWSER_SESSIONS_TAB_RESTORE_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 sessions {
14 class TabRestoreService;
17 // Singleton that owns all TabRestoreServices and associates them with
18 // Profiles. Listens for the Profile's destruction notification and cleans up
19 // the associated TabRestoreService.
20 class TabRestoreServiceFactory : public BrowserContextKeyedServiceFactory {
21 public:
22 static sessions::TabRestoreService* GetForProfile(Profile* profile);
24 // Variant of GetForProfile() that returns NULL if TabRestoreService does not
25 // exist.
26 static sessions::TabRestoreService* GetForProfileIfExisting(Profile* profile);
28 static void ResetForProfile(Profile* profile);
30 static TabRestoreServiceFactory* GetInstance();
32 private:
33 friend struct base::DefaultSingletonTraits<TabRestoreServiceFactory>;
35 TabRestoreServiceFactory();
36 ~TabRestoreServiceFactory() override;
38 // BrowserContextKeyedServiceFactory:
39 KeyedService* BuildServiceInstanceFor(
40 content::BrowserContext* browser_context) const override;
41 bool ServiceIsNULLWhileTesting() const override;
44 #endif // CHROME_BROWSER_SESSIONS_TAB_RESTORE_SERVICE_FACTORY_H_