BookmarkManager: Fix 'new folder text field size changes on clicking it' issue.
[chromium-blink-merge.git] / chrome / browser / bookmarks / bookmark_model_factory.h
blobb4a67bf28d8d44e18baf3eed6967dd1027a254c4
1 // Copyright (c) 2012 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_BOOKMARKS_BOOKMARK_MODEL_FACTORY_H_
6 #define CHROME_BROWSER_BOOKMARKS_BOOKMARK_MODEL_FACTORY_H_
8 #include "base/macros.h"
9 #include "components/keyed_service/content/browser_context_keyed_service_factory.h"
11 namespace base {
12 template <typename T> struct DefaultSingletonTraits;
15 class Profile;
17 namespace bookmarks {
18 class BookmarkModel;
21 // Singleton that owns all BookmarkModels and associates them with Profiles.
22 class BookmarkModelFactory : public BrowserContextKeyedServiceFactory {
23 public:
24 static bookmarks::BookmarkModel* GetForProfile(Profile* profile);
26 static bookmarks::BookmarkModel* GetForProfileIfExists(Profile* profile);
28 static BookmarkModelFactory* GetInstance();
30 private:
31 friend struct base::DefaultSingletonTraits<BookmarkModelFactory>;
33 BookmarkModelFactory();
34 ~BookmarkModelFactory() override;
36 // BrowserContextKeyedServiceFactory:
37 KeyedService* BuildServiceInstanceFor(
38 content::BrowserContext* context) const override;
39 void RegisterProfilePrefs(
40 user_prefs::PrefRegistrySyncable* registry) override;
41 content::BrowserContext* GetBrowserContextToUse(
42 content::BrowserContext* context) const override;
43 bool ServiceIsNULLWhileTesting() const override;
45 DISALLOW_COPY_AND_ASSIGN(BookmarkModelFactory);
48 #endif // CHROME_BROWSER_BOOKMARKS_BOOKMARK_MODEL_FACTORY_H_