| 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/autofill/autofill_manager.h" | 5 #include "chrome/browser/autofill/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 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 336 IPC_MESSAGE_HANDLER(AutofillHostMsg_DidEndTextFieldEditing, | 336 IPC_MESSAGE_HANDLER(AutofillHostMsg_DidEndTextFieldEditing, |
| 337 OnDidEndTextFieldEditing) | 337 OnDidEndTextFieldEditing) |
| 338 IPC_MESSAGE_HANDLER(AutofillHostMsg_HideAutofillPopup, | 338 IPC_MESSAGE_HANDLER(AutofillHostMsg_HideAutofillPopup, |
| 339 OnHideAutofillPopup) | 339 OnHideAutofillPopup) |
| 340 IPC_MESSAGE_HANDLER(AutofillHostMsg_ShowPasswordGenerationPopup, | 340 IPC_MESSAGE_HANDLER(AutofillHostMsg_ShowPasswordGenerationPopup, |
| 341 OnShowPasswordGenerationPopup) | 341 OnShowPasswordGenerationPopup) |
| 342 IPC_MESSAGE_HANDLER(AutofillHostMsg_AddPasswordFormMapping, | 342 IPC_MESSAGE_HANDLER(AutofillHostMsg_AddPasswordFormMapping, |
| 343 OnAddPasswordFormMapping) | 343 OnAddPasswordFormMapping) |
| 344 IPC_MESSAGE_HANDLER(AutofillHostMsg_ShowPasswordSuggestions, | 344 IPC_MESSAGE_HANDLER(AutofillHostMsg_ShowPasswordSuggestions, |
| 345 OnShowPasswordSuggestions) | 345 OnShowPasswordSuggestions) |
| 346 IPC_MESSAGE_HANDLER(AutofillHostMsg_SetDataList, |
| 347 OnSetDataList) |
| 346 IPC_MESSAGE_UNHANDLED(handled = false) | 348 IPC_MESSAGE_UNHANDLED(handled = false) |
| 347 IPC_END_MESSAGE_MAP() | 349 IPC_END_MESSAGE_MAP() |
| 348 | 350 |
| 349 return handled; | 351 return handled; |
| 350 } | 352 } |
| 351 | 353 |
| 352 bool AutofillManager::OnFormSubmitted(const FormData& form, | 354 bool AutofillManager::OnFormSubmitted(const FormData& form, |
| 353 const TimeTicks& timestamp) { | 355 const TimeTicks& timestamp) { |
| 354 // Let AutoComplete know as well. | 356 // Let AutoComplete know as well. |
| 355 tab_contents_wrapper_->autocomplete_history_manager()->OnFormSubmitted(form); | 357 tab_contents_wrapper_->autocomplete_history_manager()->OnFormSubmitted(form); |
| (...skipping 403 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 759 } | 761 } |
| 760 | 762 |
| 761 void AutofillManager::OnShowPasswordSuggestions( | 763 void AutofillManager::OnShowPasswordSuggestions( |
| 762 const webkit::forms::FormField& field, | 764 const webkit::forms::FormField& field, |
| 763 const gfx::Rect& bounds, | 765 const gfx::Rect& bounds, |
| 764 const std::vector<string16>& suggestions) { | 766 const std::vector<string16>& suggestions) { |
| 765 if (external_delegate_) | 767 if (external_delegate_) |
| 766 external_delegate_->OnShowPasswordSuggestions(suggestions, field, bounds); | 768 external_delegate_->OnShowPasswordSuggestions(suggestions, field, bounds); |
| 767 } | 769 } |
| 768 | 770 |
| 771 void AutofillManager::OnSetDataList(const std::vector<string16>& values, |
| 772 const std::vector<string16>& labels, |
| 773 const std::vector<string16>& icons, |
| 774 const std::vector<int>& unique_ids) { |
| 775 if (external_delegate_) { |
| 776 external_delegate_->SetCurrentDataListValues(values, |
| 777 labels, |
| 778 icons, |
| 779 unique_ids); |
| 780 } |
| 781 } |
| 782 |
| 769 void AutofillManager::OnLoadedServerPredictions( | 783 void AutofillManager::OnLoadedServerPredictions( |
| 770 const std::string& response_xml) { | 784 const std::string& response_xml) { |
| 771 // Parse and store the server predictions. | 785 // Parse and store the server predictions. |
| 772 FormStructure::ParseQueryResponse(response_xml, | 786 FormStructure::ParseQueryResponse(response_xml, |
| 773 form_structures_.get(), | 787 form_structures_.get(), |
| 774 *metric_logger_); | 788 *metric_logger_); |
| 775 | 789 |
| 776 // If the corresponding flag is set, annotate forms with the predicted types. | 790 // If the corresponding flag is set, annotate forms with the predicted types. |
| 777 SendAutofillTypePredictions(form_structures_.get()); | 791 SendAutofillTypePredictions(form_structures_.get()); |
| 778 } | 792 } |
| (...skipping 603 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1382 *profile_guid = IDToGUID(profile_id); | 1396 *profile_guid = IDToGUID(profile_id); |
| 1383 } | 1397 } |
| 1384 | 1398 |
| 1385 void AutofillManager::UpdateInitialInteractionTimestamp( | 1399 void AutofillManager::UpdateInitialInteractionTimestamp( |
| 1386 const TimeTicks& interaction_timestamp) { | 1400 const TimeTicks& interaction_timestamp) { |
| 1387 if (initial_interaction_timestamp_.is_null() || | 1401 if (initial_interaction_timestamp_.is_null() || |
| 1388 interaction_timestamp < initial_interaction_timestamp_) { | 1402 interaction_timestamp < initial_interaction_timestamp_) { |
| 1389 initial_interaction_timestamp_ = interaction_timestamp; | 1403 initial_interaction_timestamp_ = interaction_timestamp; |
| 1390 } | 1404 } |
| 1391 } | 1405 } |
| OLD | NEW |