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

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

Issue 12476031: Refactor notifications of chrome/browser/webdata (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 7 years, 8 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/bind.h" 7 #include "base/bind.h"
8 #include "base/files/file_path.h" 8 #include "base/files/file_path.h"
9 #include "chrome/browser/profiles/profile_dependency_manager.h" 9 #include "chrome/browser/profiles/profile_dependency_manager.h"
10 #include "chrome/browser/ui/profile_error_dialog.h" 10 #include "chrome/browser/ui/profile_error_dialog.h"
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 WebDataServiceWrapper* wrapper = 135 WebDataServiceWrapper* wrapper =
136 WebDataServiceFactory::GetForProfile( 136 WebDataServiceFactory::GetForProfile(
137 static_cast<Profile*>(context), Profile::EXPLICIT_ACCESS); 137 static_cast<Profile*>(context), Profile::EXPLICIT_ACCESS);
138 if (wrapper) 138 if (wrapper)
139 return wrapper->GetWebData(); 139 return wrapper->GetWebData();
140 // |wrapper| can be NULL in Incognito mode. 140 // |wrapper| can be NULL in Incognito mode.
141 return scoped_refptr<WebDataService>(NULL); 141 return scoped_refptr<WebDataService>(NULL);
142 } 142 }
143 143
144 WebDataServiceFactory::WebDataServiceFactory() 144 WebDataServiceFactory::WebDataServiceFactory()
145 : ProfileKeyedServiceFactory( 145 : ProfileKeyedServiceFactory("WebDataService",
146 "WebDataService", 146 ProfileDependencyManager::GetInstance()) {
147 ProfileDependencyManager::GetInstance()) {
148 // WebDataServiceFactory has no dependecies. 147 // WebDataServiceFactory has no dependecies.
149 } 148 }
150 149
151 WebDataServiceFactory::~WebDataServiceFactory() {} 150 WebDataServiceFactory::~WebDataServiceFactory() {}
152 151
153 // static 152 // static
154 WebDataServiceWrapper* WebDataServiceFactory::GetForProfile( 153 WebDataServiceWrapper* WebDataServiceFactory::GetForProfile(
155 Profile* profile, Profile::ServiceAccessType access_type) { 154 Profile* profile, Profile::ServiceAccessType access_type) {
156 // If |access_type| starts being used for anything other than this 155 // If |access_type| starts being used for anything other than this
157 // DCHECK, we need to start taking it as a parameter to 156 // DCHECK, we need to start taking it as a parameter to
(...skipping 24 matching lines...) Expand all
182 } 181 }
183 182
184 ProfileKeyedService* 183 ProfileKeyedService*
185 WebDataServiceFactory::BuildServiceInstanceFor(Profile* profile) const { 184 WebDataServiceFactory::BuildServiceInstanceFor(Profile* profile) const {
186 return new WebDataServiceWrapper(profile); 185 return new WebDataServiceWrapper(profile);
187 } 186 }
188 187
189 bool WebDataServiceFactory::ServiceIsNULLWhileTesting() const { 188 bool WebDataServiceFactory::ServiceIsNULLWhileTesting() const {
190 return true; 189 return true;
191 } 190 }
OLDNEW
« no previous file with comments | « chrome/browser/webdata/web_data_service_base.cc ('k') | chrome/browser/webdata/web_data_service_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698