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

Side by Side Diff: chrome/browser/webdata/web_data_service_factory.cc

Issue 10693153: Incognito mode should use the original profile's webdata service. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | 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/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 22 matching lines...) Expand all
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() {
43 return false; 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() {
60 return true; 60 return true;
61 } 61 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698