| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "components/webdata_services/web_data_service_wrapper.h" | 5 #include "components/webdata_services/web_data_service_wrapper.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/callback.h" | 8 #include "base/callback.h" |
| 9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
| 10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 web_database_->AddTable(base::WrapUnique(new KeywordTable)); | 81 web_database_->AddTable(base::WrapUnique(new KeywordTable)); |
| 82 // TODO(mdm): We only really need the LoginsTable on Windows for IE7 password | 82 // TODO(mdm): We only really need the LoginsTable on Windows for IE7 password |
| 83 // access, but for now, we still create it on all platforms since it deletes | 83 // access, but for now, we still create it on all platforms since it deletes |
| 84 // the old logins table. We can remove this after a while, e.g. in M22 or so. | 84 // the old logins table. We can remove this after a while, e.g. in M22 or so. |
| 85 web_database_->AddTable(base::WrapUnique(new LoginsTable)); | 85 web_database_->AddTable(base::WrapUnique(new LoginsTable)); |
| 86 web_database_->AddTable(base::WrapUnique(new TokenServiceTable)); | 86 web_database_->AddTable(base::WrapUnique(new TokenServiceTable)); |
| 87 web_database_->LoadDatabase(); | 87 web_database_->LoadDatabase(); |
| 88 | 88 |
| 89 autofill_web_data_ = new autofill::AutofillWebDataService( | 89 autofill_web_data_ = new autofill::AutofillWebDataService( |
| 90 web_database_, ui_thread, db_thread, | 90 web_database_, ui_thread, db_thread, |
| 91 base::Bind(show_error_callback, ERROR_LOADING_AUTOFILL)); | 91 base::Bind(show_error_callback, path, ERROR_LOADING_AUTOFILL)); |
| 92 autofill_web_data_->Init(); | 92 autofill_web_data_->Init(); |
| 93 | 93 |
| 94 keyword_web_data_ = new KeywordWebDataService( | 94 keyword_web_data_ = new KeywordWebDataService( |
| 95 web_database_, ui_thread, | 95 web_database_, ui_thread, |
| 96 base::Bind(show_error_callback, ERROR_LOADING_KEYWORD)); | 96 base::Bind(show_error_callback, path, ERROR_LOADING_KEYWORD)); |
| 97 keyword_web_data_->Init(); | 97 keyword_web_data_->Init(); |
| 98 | 98 |
| 99 token_web_data_ = new TokenWebData( | 99 token_web_data_ = new TokenWebData( |
| 100 web_database_, ui_thread, db_thread, | 100 web_database_, ui_thread, db_thread, |
| 101 base::Bind(show_error_callback, ERROR_LOADING_TOKEN)); | 101 base::Bind(show_error_callback, path, ERROR_LOADING_TOKEN)); |
| 102 token_web_data_->Init(); | 102 token_web_data_->Init(); |
| 103 | 103 |
| 104 #if defined(OS_WIN) | 104 #if defined(OS_WIN) |
| 105 password_web_data_ = new PasswordWebDataService( | 105 password_web_data_ = new PasswordWebDataService( |
| 106 web_database_, ui_thread, | 106 web_database_, ui_thread, |
| 107 base::Bind(show_error_callback, ERROR_LOADING_PASSWORD)); | 107 base::Bind(show_error_callback, path, ERROR_LOADING_PASSWORD)); |
| 108 password_web_data_->Init(); | 108 password_web_data_->Init(); |
| 109 #endif | 109 #endif |
| 110 | 110 |
| 111 autofill_web_data_->GetAutofillBackend( | 111 autofill_web_data_->GetAutofillBackend( |
| 112 base::Bind(&InitSyncableServicesOnDBThread, db_thread, flare, | 112 base::Bind(&InitSyncableServicesOnDBThread, db_thread, flare, |
| 113 autofill_web_data_, context_path, application_locale)); | 113 autofill_web_data_, context_path, application_locale)); |
| 114 } | 114 } |
| 115 | 115 |
| 116 WebDataServiceWrapper::~WebDataServiceWrapper() { | 116 WebDataServiceWrapper::~WebDataServiceWrapper() { |
| 117 } | 117 } |
| (...skipping 23 matching lines...) Expand all Loading... |
| 141 scoped_refptr<TokenWebData> WebDataServiceWrapper::GetTokenWebData() { | 141 scoped_refptr<TokenWebData> WebDataServiceWrapper::GetTokenWebData() { |
| 142 return token_web_data_.get(); | 142 return token_web_data_.get(); |
| 143 } | 143 } |
| 144 | 144 |
| 145 #if defined(OS_WIN) | 145 #if defined(OS_WIN) |
| 146 scoped_refptr<PasswordWebDataService> | 146 scoped_refptr<PasswordWebDataService> |
| 147 WebDataServiceWrapper::GetPasswordWebData() { | 147 WebDataServiceWrapper::GetPasswordWebData() { |
| 148 return password_web_data_.get(); | 148 return password_web_data_.get(); |
| 149 } | 149 } |
| 150 #endif | 150 #endif |
| OLD | NEW |