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

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

Issue 14103021: Use Observer to notify of WebDB load instead of callbacks (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix WIN builds Created 7 years, 7 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/browser_process.h" 9 #include "chrome/browser/browser_process.h"
10 #include "chrome/browser/profiles/profile_dependency_manager.h" 10 #include "chrome/browser/profiles/profile_dependency_manager.h"
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 scoped_ptr<WebDatabaseTable>(new LoginsTable())); 73 scoped_ptr<WebDatabaseTable>(new LoginsTable()));
74 web_database_->AddTable( 74 web_database_->AddTable(
75 scoped_ptr<WebDatabaseTable>(new TokenServiceTable())); 75 scoped_ptr<WebDatabaseTable>(new TokenServiceTable()));
76 web_database_->AddTable( 76 web_database_->AddTable(
77 scoped_ptr<WebDatabaseTable>(new WebAppsTable())); 77 scoped_ptr<WebDatabaseTable>(new WebAppsTable()));
78 // TODO(thakis): Add a migration to delete the SQL table used by 78 // TODO(thakis): Add a migration to delete the SQL table used by
79 // WebIntentsTable, then remove this. 79 // WebIntentsTable, then remove this.
80 web_database_->AddTable( 80 web_database_->AddTable(
81 scoped_ptr<WebDatabaseTable>(new WebIntentsTable())); 81 scoped_ptr<WebDatabaseTable>(new WebIntentsTable()));
82 82
83 // TODO (caitkp): Rework the callbacks here. They're ugly. 83 web_database_->LoadDatabase();
84
85 web_database_->LoadDatabase(WebDatabaseService::InitCallback());
86 84
87 autofill_web_data_ = new AutofillWebDataService( 85 autofill_web_data_ = new AutofillWebDataService(
88 web_database_, base::Bind(&ProfileErrorCallback)); 86 web_database_, base::Bind(&ProfileErrorCallback));
89 autofill_web_data_->Init(); 87 autofill_web_data_->Init();
90 88
91 web_data_ = new WebDataService( 89 web_data_ = new WebDataService(
92 web_database_, base::Bind(&ProfileErrorCallback)); 90 web_database_, base::Bind(&ProfileErrorCallback));
93 web_data_->Init(); 91 web_data_->Init();
94 92
95 BrowserThread::PostTask( 93 BrowserThread::PostTask(
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
187 } 185 }
188 186
189 ProfileKeyedService* WebDataServiceFactory::BuildServiceInstanceFor( 187 ProfileKeyedService* WebDataServiceFactory::BuildServiceInstanceFor(
190 content::BrowserContext* profile) const { 188 content::BrowserContext* profile) const {
191 return new WebDataServiceWrapper(static_cast<Profile*>(profile)); 189 return new WebDataServiceWrapper(static_cast<Profile*>(profile));
192 } 190 }
193 191
194 bool WebDataServiceFactory::ServiceIsNULLWhileTesting() const { 192 bool WebDataServiceFactory::ServiceIsNULLWhileTesting() const {
195 return true; 193 return true;
196 } 194 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698