Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(113)

Side by Side Diff: chrome/browser/bookmarks/bookmark_model_factory.cc

Issue 13865012: Change GetProfileToUse method from Profile to content::BrowserContext (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: trybots Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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 }
OLDNEW
« no previous file with comments | « chrome/browser/bookmarks/bookmark_model_factory.h ('k') | chrome/browser/captive_portal/captive_portal_service_factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698