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

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

Issue 12340111: Introduce //components/user_prefs, use to eliminate c/b/prefs dependency in Autofill. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Pure merge of LKGR Created 7 years, 9 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/memory/singleton.h" 7 #include "base/memory/singleton.h"
8 #include "base/values.h" 8 #include "base/values.h"
9 #include "chrome/browser/bookmarks/bookmark_model.h" 9 #include "chrome/browser/bookmarks/bookmark_model.h"
10 #include "chrome/browser/prefs/pref_registry_syncable.h"
11 #include "chrome/browser/profiles/profile.h" 10 #include "chrome/browser/profiles/profile.h"
12 #include "chrome/browser/profiles/profile_dependency_manager.h" 11 #include "chrome/browser/profiles/profile_dependency_manager.h"
13 #include "chrome/common/pref_names.h" 12 #include "chrome/common/pref_names.h"
13 #include "components/user_prefs/pref_registry_syncable.h"
14 14
15 // static 15 // static
16 BookmarkModel* BookmarkModelFactory::GetForProfile(Profile* profile) { 16 BookmarkModel* BookmarkModelFactory::GetForProfile(Profile* profile) {
17 return static_cast<BookmarkModel*>( 17 return static_cast<BookmarkModel*>(
18 GetInstance()->GetServiceForProfile(profile, true)); 18 GetInstance()->GetServiceForProfile(profile, true));
19 } 19 }
20 20
21 BookmarkModel* BookmarkModelFactory::GetForProfileIfExists(Profile* profile) { 21 BookmarkModel* BookmarkModelFactory::GetForProfileIfExists(Profile* profile) {
22 return static_cast<BookmarkModel*>( 22 return static_cast<BookmarkModel*>(
23 GetInstance()->GetServiceForProfile(profile, false)); 23 GetInstance()->GetServiceForProfile(profile, false));
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 bool BookmarkModelFactory::ServiceIsNULLWhileTesting() const { 59 bool BookmarkModelFactory::ServiceIsNULLWhileTesting() const {
60 return true; 60 return true;
61 } 61 }
62 62
63 // static 63 // static
64 BookmarkService* BookmarkService::FromBrowserContext( 64 BookmarkService* BookmarkService::FromBrowserContext(
65 content::BrowserContext* browser_context) { 65 content::BrowserContext* browser_context) {
66 return BookmarkModelFactory::GetForProfile( 66 return BookmarkModelFactory::GetForProfile(
67 Profile::FromBrowserContext(browser_context)); 67 Profile::FromBrowserContext(browser_context));
68 } 68 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698