| 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/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 Loading... |
| 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 } |
| OLD | NEW |