| 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 <vector> | 5 #include <vector> |
| 6 | 6 |
| 7 #include "base/memory/ref_counted.h" | 7 #include "base/memory/ref_counted.h" |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "base/memory/scoped_vector.h" | 9 #include "base/memory/scoped_vector.h" |
| 10 #include "base/string16.h" | 10 #include "base/string16.h" |
| 11 #include "base/string_number_conversions.h" | 11 #include "base/string_number_conversions.h" |
| 12 #include "base/stringprintf.h" | 12 #include "base/stringprintf.h" |
| 13 #include "base/time.h" |
| 13 #include "base/tuple.h" | 14 #include "base/tuple.h" |
| 14 #include "base/utf_string_conversions.h" | 15 #include "base/utf_string_conversions.h" |
| 15 #include "chrome/browser/autocomplete_history_manager.h" | 16 #include "chrome/browser/autocomplete_history_manager.h" |
| 16 #include "chrome/browser/autofill/autofill_common_test.h" | 17 #include "chrome/browser/autofill/autofill_common_test.h" |
| 17 #include "chrome/browser/autofill/autofill_manager.h" | 18 #include "chrome/browser/autofill/autofill_manager.h" |
| 18 #include "chrome/browser/autofill/autofill_profile.h" | 19 #include "chrome/browser/autofill/autofill_profile.h" |
| 19 #include "chrome/browser/autofill/credit_card.h" | 20 #include "chrome/browser/autofill/credit_card.h" |
| 20 #include "chrome/browser/autofill/personal_data_manager.h" | 21 #include "chrome/browser/autofill/personal_data_manager.h" |
| 21 #include "chrome/browser/prefs/pref_service.h" | 22 #include "chrome/browser/prefs/pref_service.h" |
| 22 #include "chrome/browser/profiles/profile.h" | 23 #include "chrome/browser/profiles/profile.h" |
| (...skipping 486 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 509 void AutocompleteSuggestionsReturned(const std::vector<string16>& result) { | 510 void AutocompleteSuggestionsReturned(const std::vector<string16>& result) { |
| 510 contents_wrapper()->autocomplete_history_manager()-> | 511 contents_wrapper()->autocomplete_history_manager()-> |
| 511 SendSuggestions(&result); | 512 SendSuggestions(&result); |
| 512 } | 513 } |
| 513 | 514 |
| 514 void FormsSeen(const std::vector<webkit_glue::FormData>& forms) { | 515 void FormsSeen(const std::vector<webkit_glue::FormData>& forms) { |
| 515 autofill_manager_->OnFormsSeen(forms); | 516 autofill_manager_->OnFormsSeen(forms); |
| 516 } | 517 } |
| 517 | 518 |
| 518 void FormSubmitted(const FormData& form) { | 519 void FormSubmitted(const FormData& form) { |
| 519 autofill_manager_->OnFormSubmitted(form); | 520 autofill_manager_->OnFormSubmitted(form, base::TimeTicks()); |
| 520 } | 521 } |
| 521 | 522 |
| 522 void FillAutofillFormData(int query_id, | 523 void FillAutofillFormData(int query_id, |
| 523 const webkit_glue::FormData& form, | 524 const webkit_glue::FormData& form, |
| 524 const webkit_glue::FormField& field, | 525 const webkit_glue::FormField& field, |
| 525 int unique_id) { | 526 int unique_id) { |
| 526 autofill_manager_->OnFillAutofillFormData(query_id, form, field, unique_id); | 527 autofill_manager_->OnFillAutofillFormData(query_id, form, field, unique_id); |
| 527 } | 528 } |
| 528 | 529 |
| 529 bool GetAutofillSuggestionsMessage(int* page_id, | 530 bool GetAutofillSuggestionsMessage(int* page_id, |
| (...skipping 2241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2771 const FieldTypeSet& possible_types1 = | 2772 const FieldTypeSet& possible_types1 = |
| 2772 form_structure.field(1)->possible_types(); | 2773 form_structure.field(1)->possible_types(); |
| 2773 EXPECT_EQ(1U, possible_types1.size()); | 2774 EXPECT_EQ(1U, possible_types1.size()); |
| 2774 EXPECT_TRUE(possible_types1.find(NAME_FIRST) != possible_types1.end()); | 2775 EXPECT_TRUE(possible_types1.find(NAME_FIRST) != possible_types1.end()); |
| 2775 const FieldTypeSet& possible_types2 = | 2776 const FieldTypeSet& possible_types2 = |
| 2776 form_structure.field(2)->possible_types(); | 2777 form_structure.field(2)->possible_types(); |
| 2777 EXPECT_EQ(1U, possible_types2.size()); | 2778 EXPECT_EQ(1U, possible_types2.size()); |
| 2778 EXPECT_TRUE(possible_types2.find(UNKNOWN_TYPE) != | 2779 EXPECT_TRUE(possible_types2.find(UNKNOWN_TYPE) != |
| 2779 possible_types2.end()); | 2780 possible_types2.end()); |
| 2780 } | 2781 } |
| OLD | NEW |