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

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

Issue 10908065: Introduce a couple of abstract bases for WebDataService. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 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 | Annotate | Revision Log
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/autofill_web_data_service_impl.h"
9 #include "chrome/browser/webdata/web_data_service.h" 10 #include "chrome/browser/webdata/web_data_service.h"
10 #include "chrome/common/chrome_constants.h" 11 #include "chrome/common/chrome_constants.h"
11 12
13 // static
14 scoped_ptr<AutofillWebDataService> AutofillWebDataServiceImpl::ForContext(
15 content::BrowserContext* context) {
16 // TODO(joi): Does the implicit/explicit distinction really matter?
erikwright (departed) 2012/09/11 20:49:06 Presumably you will answer this question before co
17 // It's just used for a DCHECK.
18 scoped_refptr<WebDataService> service = WebDataServiceFactory::GetForProfile(
19 static_cast<Profile*>(context), Profile::EXPLICIT_ACCESS);
20 return scoped_ptr<AutofillWebDataService>(
21 new AutofillWebDataServiceImpl(service));
22 }
23
12 WebDataServiceFactory::WebDataServiceFactory() 24 WebDataServiceFactory::WebDataServiceFactory()
13 : RefcountedProfileKeyedServiceFactory( 25 : RefcountedProfileKeyedServiceFactory(
14 "WebDataService", 26 "WebDataService",
15 ProfileDependencyManager::GetInstance()) { 27 ProfileDependencyManager::GetInstance()) {
16 // WebDataServiceFactory has no dependecies. 28 // WebDataServiceFactory has no dependecies.
17 } 29 }
18 30
19 WebDataServiceFactory::~WebDataServiceFactory() {} 31 WebDataServiceFactory::~WebDataServiceFactory() {}
20 32
21 // static 33 // static
(...skipping 30 matching lines...) Expand all
52 64
53 scoped_refptr<WebDataService> wds(new WebDataService()); 65 scoped_refptr<WebDataService> wds(new WebDataService());
54 if (!wds->Init(profile->GetPath())) 66 if (!wds->Init(profile->GetPath()))
55 NOTREACHED(); 67 NOTREACHED();
56 return wds.get(); 68 return wds.get();
57 } 69 }
58 70
59 bool WebDataServiceFactory::ServiceIsNULLWhileTesting() const { 71 bool WebDataServiceFactory::ServiceIsNULLWhileTesting() const {
60 return true; 72 return true;
61 } 73 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698