OLD | NEW |
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.h" | 5 #include "chrome/browser/webdata/web_data_service.h" |
6 | 6 |
7 #include "chrome/browser/search_engines/template_url.h" | 7 #include "chrome/browser/search_engines/template_url.h" |
8 #include "chrome/browser/webdata/autocomplete_syncable_service.h" | 8 #include "chrome/browser/webdata/autocomplete_syncable_service.h" |
9 #include "chrome/browser/webdata/autofill_change.h" | 9 #include "chrome/browser/webdata/autofill_change.h" |
10 #include "chrome/browser/webdata/autofill_entry.h" | 10 #include "chrome/browser/webdata/autofill_entry.h" |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 | 56 |
57 WDAppImagesResult::~WDAppImagesResult() {} | 57 WDAppImagesResult::~WDAppImagesResult() {} |
58 | 58 |
59 WDKeywordsResult::WDKeywordsResult() | 59 WDKeywordsResult::WDKeywordsResult() |
60 : default_search_provider_id(0), | 60 : default_search_provider_id(0), |
61 builtin_keyword_version(0) { | 61 builtin_keyword_version(0) { |
62 } | 62 } |
63 | 63 |
64 WDKeywordsResult::~WDKeywordsResult() {} | 64 WDKeywordsResult::~WDKeywordsResult() {} |
65 | 65 |
66 WebDataService::WebDataService() | 66 WebDataService::WebDataService(const ProfileErrorCallback& callback) |
67 : autocomplete_syncable_service_(NULL), | 67 : WebDataServiceBase(callback), |
| 68 autocomplete_syncable_service_(NULL), |
68 autofill_profile_syncable_service_(NULL) { | 69 autofill_profile_syncable_service_(NULL) { |
69 } | 70 } |
70 | 71 |
71 // static | 72 // static |
72 void WebDataService::NotifyOfMultipleAutofillChanges( | 73 void WebDataService::NotifyOfMultipleAutofillChanges( |
73 WebDataService* web_data_service) { | 74 WebDataService* web_data_service) { |
74 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::DB)); | 75 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::DB)); |
75 | 76 |
76 if (!web_data_service) | 77 if (!web_data_service) |
77 return; | 78 return; |
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
268 } | 269 } |
269 | 270 |
270 void WebDataService::RemoveAutofillProfilesAndCreditCardsModifiedBetween( | 271 void WebDataService::RemoveAutofillProfilesAndCreditCardsModifiedBetween( |
271 const Time& delete_begin, | 272 const Time& delete_begin, |
272 const Time& delete_end) { | 273 const Time& delete_end) { |
273 wdbs_->ScheduleDBTask(FROM_HERE, Bind( | 274 wdbs_->ScheduleDBTask(FROM_HERE, Bind( |
274 &WebDataService::RemoveAutofillProfilesAndCreditCardsModifiedBetweenImpl, | 275 &WebDataService::RemoveAutofillProfilesAndCreditCardsModifiedBetweenImpl, |
275 this, delete_begin, delete_end)); | 276 this, delete_begin, delete_end)); |
276 } | 277 } |
277 | 278 |
| 279 WebDataService::WebDataService() |
| 280 : WebDataServiceBase(ProfileErrorCallback()), |
| 281 autocomplete_syncable_service_(NULL), |
| 282 autofill_profile_syncable_service_(NULL) { |
| 283 } |
| 284 |
278 WebDataService::~WebDataService() { | 285 WebDataService::~WebDataService() { |
279 DCHECK(!autocomplete_syncable_service_); | 286 DCHECK(!autocomplete_syncable_service_); |
280 DCHECK(!autofill_profile_syncable_service_); | 287 DCHECK(!autofill_profile_syncable_service_); |
281 } | 288 } |
282 | 289 |
283 //////////////////////////////////////////////////////////////////////////////// | 290 //////////////////////////////////////////////////////////////////////////////// |
284 // | 291 // |
285 // The following methods are executed on the DB thread. | 292 // The following methods are executed on the DB thread. |
286 // | 293 // |
287 //////////////////////////////////////////////////////////////////////////////// | 294 //////////////////////////////////////////////////////////////////////////////// |
(...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
704 | 711 |
705 void WebDataService::DestroyAutofillCreditCardResult( | 712 void WebDataService::DestroyAutofillCreditCardResult( |
706 const WDTypedResult* result) { | 713 const WDTypedResult* result) { |
707 DCHECK(result->GetType() == AUTOFILL_CREDITCARDS_RESULT); | 714 DCHECK(result->GetType() == AUTOFILL_CREDITCARDS_RESULT); |
708 const WDResult<std::vector<CreditCard*> >* r = | 715 const WDResult<std::vector<CreditCard*> >* r = |
709 static_cast<const WDResult<std::vector<CreditCard*> >*>(result); | 716 static_cast<const WDResult<std::vector<CreditCard*> >*>(result); |
710 | 717 |
711 std::vector<CreditCard*> credit_cards = r->GetValue(); | 718 std::vector<CreditCard*> credit_cards = r->GetValue(); |
712 STLDeleteElements(&credit_cards); | 719 STLDeleteElements(&credit_cards); |
713 } | 720 } |
OLD | NEW |