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/deferred_sequenced_task_runner.h" | 7 #include "base/deferred_sequenced_task_runner.h" |
8 #include "base/memory/singleton.h" | 8 #include "base/memory/singleton.h" |
9 #include "base/values.h" | 9 #include "base/values.h" |
10 #include "chrome/browser/bookmarks/bookmark_model.h" | 10 #include "chrome/browser/bookmarks/bookmark_model.h" |
| 11 #include "chrome/browser/profiles/incognito_helpers.h" |
11 #include "chrome/browser/profiles/profile.h" | 12 #include "chrome/browser/profiles/profile.h" |
12 #include "chrome/browser/profiles/profile_dependency_manager.h" | 13 #include "chrome/browser/profiles/profile_dependency_manager.h" |
13 #include "chrome/browser/profiles/startup_task_runner_service.h" | 14 #include "chrome/browser/profiles/startup_task_runner_service.h" |
14 #include "chrome/browser/profiles/startup_task_runner_service_factory.h" | 15 #include "chrome/browser/profiles/startup_task_runner_service_factory.h" |
15 #include "chrome/common/pref_names.h" | 16 #include "chrome/common/pref_names.h" |
16 #include "components/user_prefs/pref_registry_syncable.h" | 17 #include "components/user_prefs/pref_registry_syncable.h" |
17 | 18 |
18 // static | 19 // static |
19 BookmarkModel* BookmarkModelFactory::GetForProfile(Profile* profile) { | 20 BookmarkModel* BookmarkModelFactory::GetForProfile(Profile* profile) { |
20 return static_cast<BookmarkModel*>( | 21 return static_cast<BookmarkModel*>( |
(...skipping 29 matching lines...) Expand all Loading... |
50 void BookmarkModelFactory::RegisterUserPrefs(PrefRegistrySyncable* registry) { | 51 void BookmarkModelFactory::RegisterUserPrefs(PrefRegistrySyncable* registry) { |
51 // Don't sync this, as otherwise, due to a limitation in sync, it | 52 // Don't sync this, as otherwise, due to a limitation in sync, it |
52 // will cause a deadlock (see http://crbug.com/97955). If we truly | 53 // will cause a deadlock (see http://crbug.com/97955). If we truly |
53 // want to sync the expanded state of folders, it should be part of | 54 // want to sync the expanded state of folders, it should be part of |
54 // bookmark sync itself (i.e., a property of the sync folder nodes). | 55 // bookmark sync itself (i.e., a property of the sync folder nodes). |
55 registry->RegisterListPref(prefs::kBookmarkEditorExpandedNodes, | 56 registry->RegisterListPref(prefs::kBookmarkEditorExpandedNodes, |
56 new base::ListValue, | 57 new base::ListValue, |
57 PrefRegistrySyncable::UNSYNCABLE_PREF); | 58 PrefRegistrySyncable::UNSYNCABLE_PREF); |
58 } | 59 } |
59 | 60 |
60 bool BookmarkModelFactory::ServiceRedirectedInIncognito() const { | 61 content::BrowserContext* BookmarkModelFactory::GetBrowserContextToUse( |
61 return true; | 62 content::BrowserContext* context) const { |
| 63 return chrome::GetBrowserContextRedirectedInIncognito(context); |
62 } | 64 } |
63 | 65 |
64 bool BookmarkModelFactory::ServiceIsNULLWhileTesting() const { | 66 bool BookmarkModelFactory::ServiceIsNULLWhileTesting() const { |
65 return true; | 67 return true; |
66 } | 68 } |
OLD | NEW |