| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
| 9 #include "base/stl_util.h" | 9 #include "base/stl_util.h" |
| 10 #include "base/threading/thread.h" | 10 #include "base/threading/thread.h" |
| 11 #include "chrome/browser/autofill/autofill_country.h" | 11 #include "chrome/browser/autofill/autofill_country.h" |
| 12 #include "chrome/browser/autofill/autofill_profile.h" | 12 #include "chrome/browser/autofill/autofill_profile.h" |
| 13 #include "chrome/browser/autofill/credit_card.h" | 13 #include "chrome/browser/autofill/credit_card.h" |
| 14 #include "chrome/browser/profiles/profile.h" | 14 #include "chrome/browser/profiles/profile.h" |
| 15 #include "chrome/browser/search_engines/template_url.h" | 15 #include "chrome/browser/search_engines/template_url.h" |
| 16 #include "chrome/browser/ui/profile_error_dialog.h" | 16 #include "chrome/browser/ui/profile_error_dialog.h" |
| 17 #include "chrome/browser/webdata/autocomplete_syncable_service.h" | 17 #include "chrome/browser/webdata/autocomplete_syncable_service.h" |
| 18 #include "chrome/browser/webdata/autofill_change.h" | 18 #include "chrome/browser/webdata/autofill_change.h" |
| 19 #include "chrome/browser/webdata/autofill_entry.h" | 19 #include "chrome/browser/webdata/autofill_entry.h" |
| 20 #include "chrome/browser/webdata/autofill_profile_syncable_service.h" | 20 #include "chrome/browser/webdata/autofill_profile_syncable_service.h" |
| 21 #include "chrome/browser/webdata/autofill_table.h" | 21 #include "chrome/browser/webdata/autofill_table.h" |
| 22 #include "chrome/browser/webdata/keyword_table.h" | 22 #include "chrome/browser/webdata/keyword_table.h" |
| 23 #include "chrome/browser/webdata/logins_table.h" | 23 #include "chrome/browser/webdata/logins_table.h" |
| 24 #include "chrome/browser/webdata/token_service_table.h" | 24 #include "chrome/browser/webdata/token_service_table.h" |
| 25 #include "chrome/browser/webdata/web_apps_table.h" | 25 #include "chrome/browser/webdata/web_apps_table.h" |
| 26 #include "chrome/browser/webdata/web_database.h" |
| 26 #include "chrome/browser/webdata/web_intents_table.h" | 27 #include "chrome/browser/webdata/web_intents_table.h" |
| 27 #include "chrome/browser/webdata/web_database.h" | |
| 28 #include "chrome/common/chrome_constants.h" | 28 #include "chrome/common/chrome_constants.h" |
| 29 #include "chrome/common/chrome_notification_types.h" | 29 #include "chrome/common/chrome_notification_types.h" |
| 30 #include "content/public/browser/notification_details.h" |
| 30 #include "content/public/browser/notification_service.h" | 31 #include "content/public/browser/notification_service.h" |
| 31 #include "content/public/browser/notification_details.h" | |
| 32 #include "content/public/browser/notification_source.h" | 32 #include "content/public/browser/notification_source.h" |
| 33 #include "grit/chromium_strings.h" | 33 #include "grit/chromium_strings.h" |
| 34 #include "grit/generated_resources.h" | 34 #include "grit/generated_resources.h" |
| 35 #include "third_party/skia/include/core/SkBitmap.h" | 35 #include "third_party/skia/include/core/SkBitmap.h" |
| 36 #include "webkit/glue/form_field.h" | 36 #include "webkit/forms/form_field.h" |
| 37 #include "webkit/glue/password_form.h" | 37 #include "webkit/forms/password_form.h" |
| 38 | 38 |
| 39 //////////////////////////////////////////////////////////////////////////////// | 39 //////////////////////////////////////////////////////////////////////////////// |
| 40 // | 40 // |
| 41 // WebDataService implementation. | 41 // WebDataService implementation. |
| 42 // | 42 // |
| 43 //////////////////////////////////////////////////////////////////////////////// | 43 //////////////////////////////////////////////////////////////////////////////// |
| 44 | 44 |
| 45 using base::Bind; | 45 using base::Bind; |
| 46 using base::Time; | 46 using base::Time; |
| 47 using content::BrowserThread; | 47 using content::BrowserThread; |
| 48 using webkit_glue::FormField; | 48 using webkit::forms::FormField; |
| 49 using webkit_glue::PasswordForm; | 49 using webkit::forms::PasswordForm; |
| 50 using webkit_glue::WebIntentServiceData; | 50 using webkit_glue::WebIntentServiceData; |
| 51 | 51 |
| 52 namespace { | 52 namespace { |
| 53 | 53 |
| 54 // A task used by WebDataService (for Sync mainly) to inform the | 54 // A task used by WebDataService (for Sync mainly) to inform the |
| 55 // PersonalDataManager living on the UI thread that it needs to refresh. | 55 // PersonalDataManager living on the UI thread that it needs to refresh. |
| 56 void NotifyOfMultipleAutofillChangesTask( | 56 void NotifyOfMultipleAutofillChangesTask( |
| 57 const scoped_refptr<WebDataService>& web_data_service) { | 57 const scoped_refptr<WebDataService>& web_data_service) { |
| 58 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 58 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 59 | 59 |
| (...skipping 1464 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1524 } | 1524 } |
| 1525 | 1525 |
| 1526 const WDTypedResult* WebDataService::WebDataRequest::GetResult() const { | 1526 const WDTypedResult* WebDataService::WebDataRequest::GetResult() const { |
| 1527 return result_; | 1527 return result_; |
| 1528 } | 1528 } |
| 1529 | 1529 |
| 1530 void WebDataService::WebDataRequest::RequestComplete() { | 1530 void WebDataService::WebDataRequest::RequestComplete() { |
| 1531 message_loop_->PostTask(FROM_HERE, Bind(&WebDataService::RequestCompleted, | 1531 message_loop_->PostTask(FROM_HERE, Bind(&WebDataService::RequestCompleted, |
| 1532 service_.get(), handle_)); | 1532 service_.get(), handle_)); |
| 1533 } | 1533 } |
| OLD | NEW |