Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(284)

Side by Side Diff: chrome/browser/autofill/autofill_manager.cc

Issue 11348273: [autofill] Fill in values on a successful run of interactive autocomplete. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: isherman@ review Created 8 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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 FormData form_data;
792 result->ToFormData(&form_data);
793 host->Send(new AutofillMsg_RequestAutocompleteSuccess(host->GetRoutingID(),
794 form_data));
794 } 795 }
795 796
796 void AutofillManager::OnLoadedServerPredictions( 797 void AutofillManager::OnLoadedServerPredictions(
797 const std::string& response_xml) { 798 const std::string& response_xml) {
798 // Parse and store the server predictions. 799 // Parse and store the server predictions.
799 FormStructure::ParseQueryResponse(response_xml, 800 FormStructure::ParseQueryResponse(response_xml,
800 form_structures_.get(), 801 form_structures_.get(),
801 *metric_logger_); 802 *metric_logger_);
802 803
803 // If the corresponding flag is set, annotate forms with the predicted types. 804 // If the corresponding flag is set, annotate forms with the predicted types.
(...skipping 525 matching lines...) Expand 10 before | Expand all | Expand 10 after
1329 *profile_guid = IDToGUID(profile_id); 1330 *profile_guid = IDToGUID(profile_id);
1330 } 1331 }
1331 1332
1332 void AutofillManager::UpdateInitialInteractionTimestamp( 1333 void AutofillManager::UpdateInitialInteractionTimestamp(
1333 const TimeTicks& interaction_timestamp) { 1334 const TimeTicks& interaction_timestamp) {
1334 if (initial_interaction_timestamp_.is_null() || 1335 if (initial_interaction_timestamp_.is_null() ||
1335 interaction_timestamp < initial_interaction_timestamp_) { 1336 interaction_timestamp < initial_interaction_timestamp_) {
1336 initial_interaction_timestamp_ = interaction_timestamp; 1337 initial_interaction_timestamp_ = interaction_timestamp;
1337 } 1338 }
1338 } 1339 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/autofill/form_structure.h » ('j') | chrome/browser/autofill/form_structure.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698