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

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

Issue 380023002: Move Password specific webdata logic into passwords component. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 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 | « chrome/browser/webdata/password_web_data_service_win.cc ('k') | chrome/chrome_browser.gypi » ('j') | 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/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/incognito_helpers.h" 10 #include "chrome/browser/profiles/incognito_helpers.h"
11 #include "chrome/browser/sync/glue/sync_start_util.h" 11 #include "chrome/browser/sync/glue/sync_start_util.h"
12 #include "chrome/browser/ui/profile_error_dialog.h" 12 #include "chrome/browser/ui/profile_error_dialog.h"
13 #include "chrome/browser/webdata/autocomplete_syncable_service.h" 13 #include "chrome/browser/webdata/autocomplete_syncable_service.h"
14 #include "chrome/browser/webdata/logins_table.h"
15 #include "chrome/browser/webdata/web_apps_table.h" 14 #include "chrome/browser/webdata/web_apps_table.h"
16 #include "chrome/browser/webdata/web_intents_table.h" 15 #include "chrome/browser/webdata/web_intents_table.h"
17 #include "components/autofill/core/browser/autofill_country.h" 16 #include "components/autofill/core/browser/autofill_country.h"
18 #include "components/autofill/core/browser/webdata/autofill_profile_syncable_ser vice.h" 17 #include "components/autofill/core/browser/webdata/autofill_profile_syncable_ser vice.h"
19 #include "components/autofill/core/browser/webdata/autofill_table.h" 18 #include "components/autofill/core/browser/webdata/autofill_table.h"
20 #include "components/autofill/core/browser/webdata/autofill_webdata_service.h" 19 #include "components/autofill/core/browser/webdata/autofill_webdata_service.h"
21 #include "components/keyed_service/content/browser_context_dependency_manager.h" 20 #include "components/keyed_service/content/browser_context_dependency_manager.h"
21 #include "components/password_manager/core/browser/webdata/logins_table.h"
22 #include "components/search_engines/keyword_table.h" 22 #include "components/search_engines/keyword_table.h"
23 #include "components/search_engines/keyword_web_data_service.h" 23 #include "components/search_engines/keyword_web_data_service.h"
24 #include "components/signin/core/browser/webdata/token_service_table.h" 24 #include "components/signin/core/browser/webdata/token_service_table.h"
25 #include "components/signin/core/browser/webdata/token_web_data.h" 25 #include "components/signin/core/browser/webdata/token_web_data.h"
26 #include "components/webdata/common/webdata_constants.h" 26 #include "components/webdata/common/webdata_constants.h"
27 #include "content/public/browser/browser_thread.h" 27 #include "content/public/browser/browser_thread.h"
28 #include "grit/chromium_strings.h" 28 #include "grit/chromium_strings.h"
29 #include "grit/generated_resources.h" 29 #include "grit/generated_resources.h"
30 30
31 #if defined(OS_WIN) 31 #if defined(OS_WIN)
32 #include "chrome/browser/webdata/password_web_data_service_win.h" 32 #include "components/password_manager/core/browser/webdata/password_web_data_ser vice_win.h"
33 #endif 33 #endif
34 34
35 using autofill::AutofillWebDataService; 35 using autofill::AutofillWebDataService;
36 using autofill::AutofillProfileSyncableService; 36 using autofill::AutofillProfileSyncableService;
37 using content::BrowserThread; 37 using content::BrowserThread;
38 38
39 namespace { 39 namespace {
40 40
41 // Callback to show error dialog on profile load error. 41 // Callback to show error dialog on profile load error.
42 void ProfileErrorCallback(ProfileErrorType type, sql::InitStatus status) { 42 void ProfileErrorCallback(ProfileErrorType type, sql::InitStatus status) {
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 token_web_data_ = new TokenWebData( 118 token_web_data_ = new TokenWebData(
119 web_database_, 119 web_database_,
120 ui_thread, 120 ui_thread,
121 db_thread, 121 db_thread,
122 base::Bind(&ProfileErrorCallback, PROFILE_ERROR_DB_TOKEN_WEB_DATA)); 122 base::Bind(&ProfileErrorCallback, PROFILE_ERROR_DB_TOKEN_WEB_DATA));
123 token_web_data_->Init(); 123 token_web_data_->Init();
124 124
125 #if defined(OS_WIN) 125 #if defined(OS_WIN)
126 password_web_data_ = new PasswordWebDataService( 126 password_web_data_ = new PasswordWebDataService(
127 web_database_, 127 web_database_,
128 ui_thread,
128 base::Bind(&ProfileErrorCallback, PROFILE_ERROR_DB_WEB_DATA)); 129 base::Bind(&ProfileErrorCallback, PROFILE_ERROR_DB_WEB_DATA));
129 password_web_data_->Init(); 130 password_web_data_->Init();
130 #endif 131 #endif
131 132
132 autofill_web_data_->GetAutofillBackend( 133 autofill_web_data_->GetAutofillBackend(
133 base::Bind(&InitSyncableServicesOnDBThread, 134 base::Bind(&InitSyncableServicesOnDBThread,
134 autofill_web_data_, 135 autofill_web_data_,
135 profile_path, 136 profile_path,
136 g_browser_process->GetApplicationLocale())); 137 g_browser_process->GetApplicationLocale()));
137 } 138 }
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
267 } 268 }
268 269
269 KeyedService* WebDataServiceFactory::BuildServiceInstanceFor( 270 KeyedService* WebDataServiceFactory::BuildServiceInstanceFor(
270 content::BrowserContext* profile) const { 271 content::BrowserContext* profile) const {
271 return new WebDataServiceWrapper(static_cast<Profile*>(profile)); 272 return new WebDataServiceWrapper(static_cast<Profile*>(profile));
272 } 273 }
273 274
274 bool WebDataServiceFactory::ServiceIsNULLWhileTesting() const { 275 bool WebDataServiceFactory::ServiceIsNULLWhileTesting() const {
275 return true; 276 return true;
276 } 277 }
OLDNEW
« no previous file with comments | « chrome/browser/webdata/password_web_data_service_win.cc ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698