| 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/webdata/web_data_service_factory.h" | 5 #include "chrome/browser/webdata/web_data_service_factory.h" |
| 6 | 6 |
| 7 #include "base/file_path.h" | 7 #include "base/file_path.h" |
| 8 #include "chrome/browser/profiles/profile_dependency_manager.h" | 8 #include "chrome/browser/profiles/profile_dependency_manager.h" |
| 9 #include "chrome/browser/webdata/web_data_service.h" | 9 #include "chrome/browser/webdata/web_data_service.h" |
| 10 #include "chrome/common/chrome_constants.h" | 10 #include "chrome/common/chrome_constants.h" |
| 11 | 11 |
| 12 // static | 12 // static |
| 13 scoped_refptr<WebDataServiceBase> WebDataServiceBase::ForProfile( | 13 scoped_refptr<WebDataServiceBase> WebDataServiceBase::ForContext( |
| 14 Profile* profile) { | 14 content::BrowserContext* context) { |
| 15 // TODO(joi): Does the implicit/explicit distinction really matter? | 15 // TODO(joi): Does the implicit/explicit distinction really matter? |
| 16 // It's just used for a DCHECK. | 16 // It's just used for a DCHECK. |
| 17 return WebDataServiceFactory::GetForProfile(profile, | 17 return WebDataServiceFactory::GetForProfile( |
| 18 Profile::EXPLICIT_ACCESS); | 18 static_cast<Profile*>(context), Profile::EXPLICIT_ACCESS); |
| 19 } | 19 } |
| 20 | 20 |
| 21 WebDataServiceFactory::WebDataServiceFactory() | 21 WebDataServiceFactory::WebDataServiceFactory() |
| 22 : RefcountedProfileKeyedServiceFactory( | 22 : RefcountedProfileKeyedServiceFactory( |
| 23 "WebDataService", | 23 "WebDataService", |
| 24 ProfileDependencyManager::GetInstance()) { | 24 ProfileDependencyManager::GetInstance()) { |
| 25 // WebDataServiceFactory has no dependecies. | 25 // WebDataServiceFactory has no dependecies. |
| 26 } | 26 } |
| 27 | 27 |
| 28 WebDataServiceFactory::~WebDataServiceFactory() {} | 28 WebDataServiceFactory::~WebDataServiceFactory() {} |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 | 61 |
| 62 scoped_refptr<WebDataService> wds(new WebDataService()); | 62 scoped_refptr<WebDataService> wds(new WebDataService()); |
| 63 if (!wds->Init(profile->GetPath())) | 63 if (!wds->Init(profile->GetPath())) |
| 64 NOTREACHED(); | 64 NOTREACHED(); |
| 65 return wds.get(); | 65 return wds.get(); |
| 66 } | 66 } |
| 67 | 67 |
| 68 bool WebDataServiceFactory::ServiceIsNULLWhileTesting() { | 68 bool WebDataServiceFactory::ServiceIsNULLWhileTesting() { |
| 69 return true; | 69 return true; |
| 70 } | 70 } |
| OLD | NEW |