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

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

Issue 10443084: Add Datalist Support to New Autofill UI (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Merging Created 8 years, 6 months 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
« no previous file with comments | « chrome/browser/autofill/autofill_manager.h ('k') | chrome/common/autofill_messages.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 325 matching lines...) Expand 10 before | Expand all | Expand 10 after
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_->autocomplete_history_manager()->OnFormSubmitted(form); 357 tab_contents_->autocomplete_history_manager()->OnFormSubmitted(form);
(...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after
764 } 766 }
765 767
766 void AutofillManager::OnShowPasswordSuggestions( 768 void AutofillManager::OnShowPasswordSuggestions(
767 const webkit::forms::FormField& field, 769 const webkit::forms::FormField& field,
768 const gfx::Rect& bounds, 770 const gfx::Rect& bounds,
769 const std::vector<string16>& suggestions) { 771 const std::vector<string16>& suggestions) {
770 if (external_delegate_) 772 if (external_delegate_)
771 external_delegate_->OnShowPasswordSuggestions(suggestions, field, bounds); 773 external_delegate_->OnShowPasswordSuggestions(suggestions, field, bounds);
772 } 774 }
773 775
776 void AutofillManager::OnSetDataList(const std::vector<string16>& values,
777 const std::vector<string16>& labels,
778 const std::vector<string16>& icons,
779 const std::vector<int>& unique_ids) {
780 if (external_delegate_) {
781 external_delegate_->SetCurrentDataListValues(values,
782 labels,
783 icons,
784 unique_ids);
785 }
786 }
787
774 void AutofillManager::OnLoadedServerPredictions( 788 void AutofillManager::OnLoadedServerPredictions(
775 const std::string& response_xml) { 789 const std::string& response_xml) {
776 // Parse and store the server predictions. 790 // Parse and store the server predictions.
777 FormStructure::ParseQueryResponse(response_xml, 791 FormStructure::ParseQueryResponse(response_xml,
778 form_structures_.get(), 792 form_structures_.get(),
779 *metric_logger_); 793 *metric_logger_);
780 794
781 // If the corresponding flag is set, annotate forms with the predicted types. 795 // If the corresponding flag is set, annotate forms with the predicted types.
782 SendAutofillTypePredictions(form_structures_.get()); 796 SendAutofillTypePredictions(form_structures_.get());
783 } 797 }
(...skipping 602 matching lines...) Expand 10 before | Expand all | Expand 10 after
1386 *profile_guid = IDToGUID(profile_id); 1400 *profile_guid = IDToGUID(profile_id);
1387 } 1401 }
1388 1402
1389 void AutofillManager::UpdateInitialInteractionTimestamp( 1403 void AutofillManager::UpdateInitialInteractionTimestamp(
1390 const TimeTicks& interaction_timestamp) { 1404 const TimeTicks& interaction_timestamp) {
1391 if (initial_interaction_timestamp_.is_null() || 1405 if (initial_interaction_timestamp_.is_null() ||
1392 interaction_timestamp < initial_interaction_timestamp_) { 1406 interaction_timestamp < initial_interaction_timestamp_) {
1393 initial_interaction_timestamp_ = interaction_timestamp; 1407 initial_interaction_timestamp_ = interaction_timestamp;
1394 } 1408 }
1395 } 1409 }
OLDNEW
« no previous file with comments | « chrome/browser/autofill/autofill_manager.h ('k') | chrome/common/autofill_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698