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

Side by Side Diff: chrome/browser/web_data_service_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
« no previous file with comments | « chrome/browser/web_data_service_factory.h ('k') | chrome/common/mac/launchd.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/web_data_service_factory.h" 5 #include "chrome/browser/web_data_service_factory.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/files/file_path.h" 8 #include "base/files/file_path.h"
9 #include "base/memory/singleton.h" 9 #include "base/memory/singleton.h"
10 #include "chrome/browser/browser_process.h" 10 #include "chrome/browser/browser_process.h"
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 WebDataServiceFactory::GetForProfile(profile, access_type); 146 WebDataServiceFactory::GetForProfile(profile, access_type);
147 // |wrapper| can be null in Incognito mode. 147 // |wrapper| can be null in Incognito mode.
148 return wrapper ? 148 return wrapper ?
149 wrapper->GetPasswordWebData() : 149 wrapper->GetPasswordWebData() :
150 scoped_refptr<PasswordWebDataService>(nullptr); 150 scoped_refptr<PasswordWebDataService>(nullptr);
151 } 151 }
152 #endif 152 #endif
153 153
154 // static 154 // static
155 WebDataServiceFactory* WebDataServiceFactory::GetInstance() { 155 WebDataServiceFactory* WebDataServiceFactory::GetInstance() {
156 return Singleton<WebDataServiceFactory>::get(); 156 return base::Singleton<WebDataServiceFactory>::get();
157 } 157 }
158 158
159 content::BrowserContext* WebDataServiceFactory::GetBrowserContextToUse( 159 content::BrowserContext* WebDataServiceFactory::GetBrowserContextToUse(
160 content::BrowserContext* context) const { 160 content::BrowserContext* context) const {
161 return chrome::GetBrowserContextRedirectedInIncognito(context); 161 return chrome::GetBrowserContextRedirectedInIncognito(context);
162 } 162 }
163 163
164 KeyedService* WebDataServiceFactory::BuildServiceInstanceFor( 164 KeyedService* WebDataServiceFactory::BuildServiceInstanceFor(
165 content::BrowserContext* context) const { 165 content::BrowserContext* context) const {
166 const base::FilePath& profile_path = context->GetPath(); 166 const base::FilePath& profile_path = context->GetPath();
167 return new WebDataServiceWrapper( 167 return new WebDataServiceWrapper(
168 profile_path, g_browser_process->GetApplicationLocale(), 168 profile_path, g_browser_process->GetApplicationLocale(),
169 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::UI), 169 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::UI),
170 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::DB), 170 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::DB),
171 sync_start_util::GetFlareForSyncableService(profile_path), 171 sync_start_util::GetFlareForSyncableService(profile_path),
172 &ProfileErrorCallback); 172 &ProfileErrorCallback);
173 } 173 }
174 174
175 bool WebDataServiceFactory::ServiceIsNULLWhileTesting() const { 175 bool WebDataServiceFactory::ServiceIsNULLWhileTesting() const {
176 return true; 176 return true;
177 } 177 }
OLDNEW
« no previous file with comments | « chrome/browser/web_data_service_factory.h ('k') | chrome/common/mac/launchd.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698