| 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 "base/stl_util.h" | 7 #include "base/stl_util.h" |
| 8 #include "chrome/browser/search_engines/template_url.h" | 8 #include "chrome/browser/search_engines/template_url.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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 | 55 |
| 56 WDAppImagesResult::~WDAppImagesResult() {} | 56 WDAppImagesResult::~WDAppImagesResult() {} |
| 57 | 57 |
| 58 WDKeywordsResult::WDKeywordsResult() | 58 WDKeywordsResult::WDKeywordsResult() |
| 59 : default_search_provider_id(0), | 59 : default_search_provider_id(0), |
| 60 builtin_keyword_version(0) { | 60 builtin_keyword_version(0) { |
| 61 } | 61 } |
| 62 | 62 |
| 63 WDKeywordsResult::~WDKeywordsResult() {} | 63 WDKeywordsResult::~WDKeywordsResult() {} |
| 64 | 64 |
| 65 WebDataService::WebDataService(const base::FilePath& path, | 65 WebDataService::WebDataService( |
| 66 const ProfileErrorCallback& callback) | 66 scoped_refptr<WebDatabaseService> wdbs, |
| 67 : WebDataServiceBase(path, callback) { | 67 const ProfileErrorCallback& callback) |
| 68 : WebDataServiceBase(wdbs, callback) { |
| 68 } | 69 } |
| 69 | 70 |
| 70 // static | 71 // static |
| 71 void WebDataService::NotifyOfMultipleAutofillChanges( | 72 void WebDataService::NotifyOfMultipleAutofillChanges( |
| 72 WebDataService* web_data_service) { | 73 WebDataService* web_data_service) { |
| 73 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::DB)); | 74 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::DB)); |
| 74 | 75 |
| 75 if (!web_data_service) | 76 if (!web_data_service) |
| 76 return; | 77 return; |
| 77 | 78 |
| (...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 256 | 257 |
| 257 void WebDataService::RemoveAutofillProfilesAndCreditCardsModifiedBetween( | 258 void WebDataService::RemoveAutofillProfilesAndCreditCardsModifiedBetween( |
| 258 const Time& delete_begin, | 259 const Time& delete_begin, |
| 259 const Time& delete_end) { | 260 const Time& delete_end) { |
| 260 wdbs_->ScheduleDBTask(FROM_HERE, Bind( | 261 wdbs_->ScheduleDBTask(FROM_HERE, Bind( |
| 261 &WebDataService::RemoveAutofillProfilesAndCreditCardsModifiedBetweenImpl, | 262 &WebDataService::RemoveAutofillProfilesAndCreditCardsModifiedBetweenImpl, |
| 262 this, delete_begin, delete_end)); | 263 this, delete_begin, delete_end)); |
| 263 } | 264 } |
| 264 | 265 |
| 265 WebDataService::WebDataService() | 266 WebDataService::WebDataService() |
| 266 : WebDataServiceBase(base::FilePath(), ProfileErrorCallback()) { | 267 : WebDataServiceBase(NULL, ProfileErrorCallback()) { |
| 267 } | 268 } |
| 268 | 269 |
| 269 WebDataService::~WebDataService() { | 270 WebDataService::~WebDataService() { |
| 270 } | 271 } |
| 271 | 272 |
| 272 //////////////////////////////////////////////////////////////////////////////// | 273 //////////////////////////////////////////////////////////////////////////////// |
| 273 // | 274 // |
| 274 // Keywords implementation. | 275 // Keywords implementation. |
| 275 // | 276 // |
| 276 //////////////////////////////////////////////////////////////////////////////// | 277 //////////////////////////////////////////////////////////////////////////////// |
| (...skipping 376 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 653 | 654 |
| 654 void WebDataService::DestroyAutofillCreditCardResult( | 655 void WebDataService::DestroyAutofillCreditCardResult( |
| 655 const WDTypedResult* result) { | 656 const WDTypedResult* result) { |
| 656 DCHECK(result->GetType() == AUTOFILL_CREDITCARDS_RESULT); | 657 DCHECK(result->GetType() == AUTOFILL_CREDITCARDS_RESULT); |
| 657 const WDResult<std::vector<CreditCard*> >* r = | 658 const WDResult<std::vector<CreditCard*> >* r = |
| 658 static_cast<const WDResult<std::vector<CreditCard*> >*>(result); | 659 static_cast<const WDResult<std::vector<CreditCard*> >*>(result); |
| 659 | 660 |
| 660 std::vector<CreditCard*> credit_cards = r->GetValue(); | 661 std::vector<CreditCard*> credit_cards = r->GetValue(); |
| 661 STLDeleteElements(&credit_cards); | 662 STLDeleteElements(&credit_cards); |
| 662 } | 663 } |
| OLD | NEW |