| 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" |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 DCHECK(access_type != Profile::IMPLICIT_ACCESS || !profile->IsOffTheRecord()); | 32 DCHECK(access_type != Profile::IMPLICIT_ACCESS || !profile->IsOffTheRecord()); |
| 33 return static_cast<WebDataService*>( | 33 return static_cast<WebDataService*>( |
| 34 GetInstance()->GetServiceForProfile(profile, false).get()); | 34 GetInstance()->GetServiceForProfile(profile, false).get()); |
| 35 } | 35 } |
| 36 | 36 |
| 37 // static | 37 // static |
| 38 WebDataServiceFactory* WebDataServiceFactory::GetInstance() { | 38 WebDataServiceFactory* WebDataServiceFactory::GetInstance() { |
| 39 return Singleton<WebDataServiceFactory>::get(); | 39 return Singleton<WebDataServiceFactory>::get(); |
| 40 } | 40 } |
| 41 | 41 |
| 42 bool WebDataServiceFactory::ServiceRedirectedInIncognito() { | 42 bool WebDataServiceFactory::ServiceRedirectedInIncognito() const { |
| 43 return true; | 43 return true; |
| 44 } | 44 } |
| 45 | 45 |
| 46 scoped_refptr<RefcountedProfileKeyedService> | 46 scoped_refptr<RefcountedProfileKeyedService> |
| 47 WebDataServiceFactory::BuildServiceInstanceFor(Profile* profile) const { | 47 WebDataServiceFactory::BuildServiceInstanceFor(Profile* profile) const { |
| 48 DCHECK(profile); | 48 DCHECK(profile); |
| 49 | 49 |
| 50 FilePath path = profile->GetPath(); | 50 FilePath path = profile->GetPath(); |
| 51 path = path.Append(chrome::kWebDataFilename); | 51 path = path.Append(chrome::kWebDataFilename); |
| 52 | 52 |
| 53 scoped_refptr<WebDataService> wds(new WebDataService()); | 53 scoped_refptr<WebDataService> wds(new WebDataService()); |
| 54 if (!wds->Init(profile->GetPath())) | 54 if (!wds->Init(profile->GetPath())) |
| 55 NOTREACHED(); | 55 NOTREACHED(); |
| 56 return wds.get(); | 56 return wds.get(); |
| 57 } | 57 } |
| 58 | 58 |
| 59 bool WebDataServiceFactory::ServiceIsNULLWhileTesting() { | 59 bool WebDataServiceFactory::ServiceIsNULLWhileTesting() const { |
| 60 return true; | 60 return true; |
| 61 } | 61 } |
| OLD | NEW |