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

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

Issue 1308823002: Move Singleton and related structs to namespace base (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: ToT Created 5 years, 3 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
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/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 28 matching lines...) Expand all
39 } 39 }
40 40
41 // static 41 // static
42 BookmarkModel* BookmarkModelFactory::GetForProfileIfExists(Profile* profile) { 42 BookmarkModel* BookmarkModelFactory::GetForProfileIfExists(Profile* profile) {
43 return static_cast<BookmarkModel*>( 43 return static_cast<BookmarkModel*>(
44 GetInstance()->GetServiceForBrowserContext(profile, false)); 44 GetInstance()->GetServiceForBrowserContext(profile, false));
45 } 45 }
46 46
47 // static 47 // static
48 BookmarkModelFactory* BookmarkModelFactory::GetInstance() { 48 BookmarkModelFactory* BookmarkModelFactory::GetInstance() {
49 return Singleton<BookmarkModelFactory>::get(); 49 return base::Singleton<BookmarkModelFactory>::get();
50 } 50 }
51 51
52 BookmarkModelFactory::BookmarkModelFactory() 52 BookmarkModelFactory::BookmarkModelFactory()
53 : BrowserContextKeyedServiceFactory( 53 : BrowserContextKeyedServiceFactory(
54 "BookmarkModel", 54 "BookmarkModel",
55 BrowserContextDependencyManager::GetInstance()) { 55 BrowserContextDependencyManager::GetInstance()) {
56 DependsOn(BookmarkUndoServiceFactory::GetInstance()); 56 DependsOn(BookmarkUndoServiceFactory::GetInstance());
57 DependsOn(ChromeBookmarkClientFactory::GetInstance()); 57 DependsOn(ChromeBookmarkClientFactory::GetInstance());
58 DependsOn(StartupTaskRunnerServiceFactory::GetInstance()); 58 DependsOn(StartupTaskRunnerServiceFactory::GetInstance());
59 #if defined(OS_ANDROID) 59 #if defined(OS_ANDROID)
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 } 104 }
105 105
106 content::BrowserContext* BookmarkModelFactory::GetBrowserContextToUse( 106 content::BrowserContext* BookmarkModelFactory::GetBrowserContextToUse(
107 content::BrowserContext* context) const { 107 content::BrowserContext* context) const {
108 return chrome::GetBrowserContextRedirectedInIncognito(context); 108 return chrome::GetBrowserContextRedirectedInIncognito(context);
109 } 109 }
110 110
111 bool BookmarkModelFactory::ServiceIsNULLWhileTesting() const { 111 bool BookmarkModelFactory::ServiceIsNULLWhileTesting() const {
112 return true; 112 return true;
113 } 113 }
OLDNEW
« no previous file with comments | « chrome/browser/bookmarks/bookmark_model_factory.h ('k') | chrome/browser/bookmarks/chrome_bookmark_client_factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698