OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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 #include "chrome/browser/bookmarks/bookmark_model_factory.h" | 5 #include "chrome/browser/bookmarks/bookmark_model_factory.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/deferred_sequenced_task_runner.h" | 8 #include "base/deferred_sequenced_task_runner.h" |
9 #include "base/memory/singleton.h" | 9 #include "base/memory/singleton.h" |
10 #include "base/prefs/pref_service.h" | 10 #include "base/prefs/pref_service.h" |
(...skipping 28 matching lines...) Expand all Loading... |
39 } | 39 } |
40 | 40 |
41 // static | 41 // static |
42 BookmarkModel* BookmarkModelFactory::GetForProfileIfExists(Profile* profile) { | 42 BookmarkModel* BookmarkModelFactory::GetForProfileIfExists(Profile* profile) { |
43 return static_cast<BookmarkModel*>( | 43 return static_cast<BookmarkModel*>( |
44 GetInstance()->GetServiceForBrowserContext(profile, false)); | 44 GetInstance()->GetServiceForBrowserContext(profile, false)); |
45 } | 45 } |
46 | 46 |
47 // static | 47 // static |
48 BookmarkModelFactory* BookmarkModelFactory::GetInstance() { | 48 BookmarkModelFactory* BookmarkModelFactory::GetInstance() { |
49 return Singleton<BookmarkModelFactory>::get(); | 49 return base::Singleton<BookmarkModelFactory>::get(); |
50 } | 50 } |
51 | 51 |
52 BookmarkModelFactory::BookmarkModelFactory() | 52 BookmarkModelFactory::BookmarkModelFactory() |
53 : BrowserContextKeyedServiceFactory( | 53 : BrowserContextKeyedServiceFactory( |
54 "BookmarkModel", | 54 "BookmarkModel", |
55 BrowserContextDependencyManager::GetInstance()) { | 55 BrowserContextDependencyManager::GetInstance()) { |
56 DependsOn(BookmarkUndoServiceFactory::GetInstance()); | 56 DependsOn(BookmarkUndoServiceFactory::GetInstance()); |
57 DependsOn(ChromeBookmarkClientFactory::GetInstance()); | 57 DependsOn(ChromeBookmarkClientFactory::GetInstance()); |
58 DependsOn(StartupTaskRunnerServiceFactory::GetInstance()); | 58 DependsOn(StartupTaskRunnerServiceFactory::GetInstance()); |
59 #if defined(OS_ANDROID) | 59 #if defined(OS_ANDROID) |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 } | 104 } |
105 | 105 |
106 content::BrowserContext* BookmarkModelFactory::GetBrowserContextToUse( | 106 content::BrowserContext* BookmarkModelFactory::GetBrowserContextToUse( |
107 content::BrowserContext* context) const { | 107 content::BrowserContext* context) const { |
108 return chrome::GetBrowserContextRedirectedInIncognito(context); | 108 return chrome::GetBrowserContextRedirectedInIncognito(context); |
109 } | 109 } |
110 | 110 |
111 bool BookmarkModelFactory::ServiceIsNULLWhileTesting() const { | 111 bool BookmarkModelFactory::ServiceIsNULLWhileTesting() const { |
112 return true; | 112 return true; |
113 } | 113 } |
OLD | NEW |