| 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 525 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1329 *profile_guid = IDToGUID(profile_id); | 1328 *profile_guid = IDToGUID(profile_id); |
| 1330 } | 1329 } |
| 1331 | 1330 |
| 1332 void AutofillManager::UpdateInitialInteractionTimestamp( | 1331 void AutofillManager::UpdateInitialInteractionTimestamp( |
| 1333 const TimeTicks& interaction_timestamp) { | 1332 const TimeTicks& interaction_timestamp) { |
| 1334 if (initial_interaction_timestamp_.is_null() || | 1333 if (initial_interaction_timestamp_.is_null() || |
| 1335 interaction_timestamp < initial_interaction_timestamp_) { | 1334 interaction_timestamp < initial_interaction_timestamp_) { |
| 1336 initial_interaction_timestamp_ = interaction_timestamp; | 1335 initial_interaction_timestamp_ = interaction_timestamp; |
| 1337 } | 1336 } |
| 1338 } | 1337 } |
| OLD | NEW |