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 766 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
777 callback); | 777 callback); |
778 controller->Show(); | 778 controller->Show(); |
779 } | 779 } |
780 | 780 |
781 void AutofillManager::ReturnAutocompleteData(const FormStructure* result) { | 781 void AutofillManager::ReturnAutocompleteData(const FormStructure* result) { |
782 RenderViewHost* host = web_contents()->GetRenderViewHost(); | 782 RenderViewHost* host = web_contents()->GetRenderViewHost(); |
783 if (!host) | 783 if (!host) |
784 return; | 784 return; |
785 | 785 |
786 if (!result) { | 786 if (!result) { |
787 host->Send(new AutofillMsg_RequestAutocompleteFinished( | 787 host->Send(new AutofillMsg_RequestAutocompleteError(host->GetRoutingID())); |
788 host->GetRoutingID(), WebKit::WebFormElement::AutocompleteResultError)); | 788 return; |
789 } else { | |
790 // TODO(estade): implement non-failure case. | |
791 host->Send(new AutofillMsg_RequestAutocompleteFinished( | |
792 host->GetRoutingID(), WebKit::WebFormElement::AutocompleteResultError)); | |
793 } | 789 } |
| 790 |
| 791 host->Send(new AutofillMsg_RequestAutocompleteSuccess(host->GetRoutingID(), |
| 792 result->ToFormData())); |
794 } | 793 } |
795 | 794 |
796 void AutofillManager::OnLoadedServerPredictions( | 795 void AutofillManager::OnLoadedServerPredictions( |
797 const std::string& response_xml) { | 796 const std::string& response_xml) { |
798 // Parse and store the server predictions. | 797 // Parse and store the server predictions. |
799 FormStructure::ParseQueryResponse(response_xml, | 798 FormStructure::ParseQueryResponse(response_xml, |
800 form_structures_.get(), | 799 form_structures_.get(), |
801 *metric_logger_); | 800 *metric_logger_); |
802 | 801 |
803 // If the corresponding flag is set, annotate forms with the predicted types. | 802 // If the corresponding flag is set, annotate forms with the predicted types. |
(...skipping 510 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1314 *profile_guid = IDToGUID(profile_id); | 1313 *profile_guid = IDToGUID(profile_id); |
1315 } | 1314 } |
1316 | 1315 |
1317 void AutofillManager::UpdateInitialInteractionTimestamp( | 1316 void AutofillManager::UpdateInitialInteractionTimestamp( |
1318 const TimeTicks& interaction_timestamp) { | 1317 const TimeTicks& interaction_timestamp) { |
1319 if (initial_interaction_timestamp_.is_null() || | 1318 if (initial_interaction_timestamp_.is_null() || |
1320 interaction_timestamp < initial_interaction_timestamp_) { | 1319 interaction_timestamp < initial_interaction_timestamp_) { |
1321 initial_interaction_timestamp_ = interaction_timestamp; | 1320 initial_interaction_timestamp_ = interaction_timestamp; |
1322 } | 1321 } |
1323 } | 1322 } |
OLD | NEW |