| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/autofill/core/browser/autofill_manager.h" | 5 #include "components/autofill/core/browser/autofill_manager.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <limits> | 9 #include <limits> |
| 10 #include <map> | 10 #include <map> |
| (...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 350 AutofillMetrics::USER_DID_EDIT_AUTOFILLED_FIELD_ONCE); | 350 AutofillMetrics::USER_DID_EDIT_AUTOFILLED_FIELD_ONCE); |
| 351 } | 351 } |
| 352 } | 352 } |
| 353 | 353 |
| 354 UpdateInitialInteractionTimestamp(timestamp); | 354 UpdateInitialInteractionTimestamp(timestamp); |
| 355 } | 355 } |
| 356 | 356 |
| 357 void AutofillManager::OnQueryFormFieldAutofill(int query_id, | 357 void AutofillManager::OnQueryFormFieldAutofill(int query_id, |
| 358 const FormData& form, | 358 const FormData& form, |
| 359 const FormFieldData& field, | 359 const FormFieldData& field, |
| 360 const PasswordForm& passwordform, |
| 360 const gfx::RectF& bounding_box, | 361 const gfx::RectF& bounding_box, |
| 361 bool display_warning) { | 362 bool display_warning) { |
| 362 std::vector<base::string16> values; | 363 std::vector<base::string16> values; |
| 363 std::vector<base::string16> labels; | 364 std::vector<base::string16> labels; |
| 364 std::vector<base::string16> icons; | 365 std::vector<base::string16> icons; |
| 365 std::vector<int> unique_ids; | 366 std::vector<int> unique_ids; |
| 366 | 367 |
| 367 external_delegate_->OnQuery(query_id, | 368 external_delegate_->OnQuery(query_id, |
| 368 form, | 369 form, |
| 369 field, | 370 field, |
| 371 passwordform, |
| 370 bounding_box, | 372 bounding_box, |
| 371 display_warning); | 373 display_warning); |
| 372 | 374 |
| 373 RenderViewHost* host = NULL; | 375 RenderViewHost* host = NULL; |
| 374 FormStructure* form_structure = NULL; | 376 FormStructure* form_structure = NULL; |
| 375 AutofillField* autofill_field = NULL; | 377 AutofillField* autofill_field = NULL; |
| 376 if (GetHost(&host) && | 378 if (GetHost(&host) && |
| 377 GetCachedFormAndField(form, field, &form_structure, &autofill_field) && | 379 GetCachedFormAndField(form, field, &form_structure, &autofill_field) && |
| 378 // Don't send suggestions for forms that aren't auto-fillable. | 380 // Don't send suggestions for forms that aren't auto-fillable. |
| 379 form_structure->IsAutofillable(false)) { | 381 form_structure->IsAutofillable(false)) { |
| (...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 605 } | 607 } |
| 606 | 608 |
| 607 void AutofillManager::OnAddPasswordFormMapping( | 609 void AutofillManager::OnAddPasswordFormMapping( |
| 608 const FormFieldData& form, | 610 const FormFieldData& form, |
| 609 const PasswordFormFillData& fill_data) { | 611 const PasswordFormFillData& fill_data) { |
| 610 external_delegate_->AddPasswordFormMapping(form, fill_data); | 612 external_delegate_->AddPasswordFormMapping(form, fill_data); |
| 611 } | 613 } |
| 612 | 614 |
| 613 void AutofillManager::OnShowPasswordSuggestions( | 615 void AutofillManager::OnShowPasswordSuggestions( |
| 614 const FormFieldData& field, | 616 const FormFieldData& field, |
| 617 const PasswordForm& passwordform, |
| 615 const gfx::RectF& bounds, | 618 const gfx::RectF& bounds, |
| 616 const std::vector<base::string16>& suggestions, | 619 const std::vector<base::string16>& suggestions, |
| 617 const std::vector<base::string16>& realms) { | 620 const std::vector<base::string16>& realms) { |
| 618 external_delegate_->OnShowPasswordSuggestions(suggestions, | 621 external_delegate_->OnShowPasswordSuggestions(suggestions, |
| 622 passwordform, |
| 619 realms, | 623 realms, |
| 620 field, | 624 field, |
| 621 bounds); | 625 bounds); |
| 622 } | 626 } |
| 623 | 627 |
| 624 void AutofillManager::OnSetDataList(const std::vector<base::string16>& values, | 628 void AutofillManager::OnSetDataList(const std::vector<base::string16>& values, |
| 625 const std::vector<base::string16>& labels) { | 629 const std::vector<base::string16>& labels) { |
| 626 if (values.size() != labels.size()) | 630 if (values.size() != labels.size()) |
| 627 return; | 631 return; |
| 628 | 632 |
| (...skipping 482 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1111 return false; | 1115 return false; |
| 1112 | 1116 |
| 1113 // Disregard forms that we wouldn't ever autofill in the first place. | 1117 // Disregard forms that we wouldn't ever autofill in the first place. |
| 1114 if (!form.ShouldBeParsed(true)) | 1118 if (!form.ShouldBeParsed(true)) |
| 1115 return false; | 1119 return false; |
| 1116 | 1120 |
| 1117 return true; | 1121 return true; |
| 1118 } | 1122 } |
| 1119 | 1123 |
| 1120 } // namespace autofill | 1124 } // namespace autofill |
| OLD | NEW |