| 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/values.h" | 10 #include "base/values.h" |
| 11 #include "chrome/browser/bookmarks/bookmark_model.h" | 11 #include "chrome/browser/bookmarks/bookmark_model.h" |
| 12 #include "chrome/browser/profiles/incognito_helpers.h" | 12 #include "chrome/browser/profiles/incognito_helpers.h" |
| 13 #include "chrome/browser/profiles/profile.h" | 13 #include "chrome/browser/profiles/profile.h" |
| 14 #include "chrome/browser/profiles/startup_task_runner_service.h" | 14 #include "chrome/browser/profiles/startup_task_runner_service.h" |
| 15 #include "chrome/browser/profiles/startup_task_runner_service_factory.h" | 15 #include "chrome/browser/profiles/startup_task_runner_service_factory.h" |
| 16 #include "chrome/browser/undo/bookmark_undo_service.h" | 16 #include "chrome/browser/undo/bookmark_undo_service.h" |
| 17 #include "chrome/browser/undo/bookmark_undo_service_factory.h" | 17 #include "chrome/browser/undo/bookmark_undo_service_factory.h" |
| 18 #include "chrome/common/chrome_switches.h" | 18 #include "chrome/common/chrome_switches.h" |
| 19 #include "chrome/common/pref_names.h" | 19 #include "chrome/common/pref_names.h" |
| 20 #include "components/bookmarks/bookmark_pref_names.h" |
| 20 #include "components/keyed_service/content/browser_context_dependency_manager.h" | 21 #include "components/keyed_service/content/browser_context_dependency_manager.h" |
| 21 #include "components/user_prefs/pref_registry_syncable.h" | 22 #include "components/user_prefs/pref_registry_syncable.h" |
| 22 | 23 |
| 23 // static | 24 // static |
| 24 BookmarkModel* BookmarkModelFactory::GetForProfile(Profile* profile) { | 25 BookmarkModel* BookmarkModelFactory::GetForProfile(Profile* profile) { |
| 25 return static_cast<BookmarkModel*>( | 26 return static_cast<BookmarkModel*>( |
| 26 GetInstance()->GetServiceForBrowserContext(profile, true)); | 27 GetInstance()->GetServiceForBrowserContext(profile, true)); |
| 27 } | 28 } |
| 28 | 29 |
| 29 BookmarkModel* BookmarkModelFactory::GetForProfileIfExists(Profile* profile) { | 30 BookmarkModel* BookmarkModelFactory::GetForProfileIfExists(Profile* profile) { |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 } | 73 } |
| 73 | 74 |
| 74 content::BrowserContext* BookmarkModelFactory::GetBrowserContextToUse( | 75 content::BrowserContext* BookmarkModelFactory::GetBrowserContextToUse( |
| 75 content::BrowserContext* context) const { | 76 content::BrowserContext* context) const { |
| 76 return chrome::GetBrowserContextRedirectedInIncognito(context); | 77 return chrome::GetBrowserContextRedirectedInIncognito(context); |
| 77 } | 78 } |
| 78 | 79 |
| 79 bool BookmarkModelFactory::ServiceIsNULLWhileTesting() const { | 80 bool BookmarkModelFactory::ServiceIsNULLWhileTesting() const { |
| 80 return true; | 81 return true; |
| 81 } | 82 } |
| OLD | NEW |