| 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 22 matching lines...) Expand all Loading... |
| 33 } | 33 } |
| 34 | 34 |
| 35 // static | 35 // static |
| 36 BookmarkModel* BookmarkModelFactory::GetForProfileIfExists(Profile* profile) { | 36 BookmarkModel* BookmarkModelFactory::GetForProfileIfExists(Profile* profile) { |
| 37 return static_cast<BookmarkModel*>( | 37 return static_cast<BookmarkModel*>( |
| 38 GetInstance()->GetServiceForBrowserContext(profile, false)); | 38 GetInstance()->GetServiceForBrowserContext(profile, false)); |
| 39 } | 39 } |
| 40 | 40 |
| 41 // static | 41 // static |
| 42 BookmarkModelFactory* BookmarkModelFactory::GetInstance() { | 42 BookmarkModelFactory* BookmarkModelFactory::GetInstance() { |
| 43 return Singleton<BookmarkModelFactory>::get(); | 43 return base::Singleton<BookmarkModelFactory>::get(); |
| 44 } | 44 } |
| 45 | 45 |
| 46 BookmarkModelFactory::BookmarkModelFactory() | 46 BookmarkModelFactory::BookmarkModelFactory() |
| 47 : BrowserContextKeyedServiceFactory( | 47 : BrowserContextKeyedServiceFactory( |
| 48 "BookmarkModel", | 48 "BookmarkModel", |
| 49 BrowserContextDependencyManager::GetInstance()) { | 49 BrowserContextDependencyManager::GetInstance()) { |
| 50 DependsOn(BookmarkUndoServiceFactory::GetInstance()); | 50 DependsOn(BookmarkUndoServiceFactory::GetInstance()); |
| 51 DependsOn(ChromeBookmarkClientFactory::GetInstance()); | 51 DependsOn(ChromeBookmarkClientFactory::GetInstance()); |
| 52 DependsOn(StartupTaskRunnerServiceFactory::GetInstance()); | 52 DependsOn(StartupTaskRunnerServiceFactory::GetInstance()); |
| 53 } | 53 } |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 } | 86 } |
| 87 | 87 |
| 88 content::BrowserContext* BookmarkModelFactory::GetBrowserContextToUse( | 88 content::BrowserContext* BookmarkModelFactory::GetBrowserContextToUse( |
| 89 content::BrowserContext* context) const { | 89 content::BrowserContext* context) const { |
| 90 return chrome::GetBrowserContextRedirectedInIncognito(context); | 90 return chrome::GetBrowserContextRedirectedInIncognito(context); |
| 91 } | 91 } |
| 92 | 92 |
| 93 bool BookmarkModelFactory::ServiceIsNULLWhileTesting() const { | 93 bool BookmarkModelFactory::ServiceIsNULLWhileTesting() const { |
| 94 return true; | 94 return true; |
| 95 } | 95 } |
| OLD | NEW |