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

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: 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
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_wrapper_->autocomplete_history_manager()->OnFormSubmitted(form); 357 tab_contents_wrapper_->autocomplete_history_manager()->OnFormSubmitted(form);
(...skipping 405 matching lines...) Expand 10 before | Expand all | Expand 10 after
761 } 763 }
762 764
763 void AutofillManager::OnShowPasswordSuggestions( 765 void AutofillManager::OnShowPasswordSuggestions(
764 const webkit::forms::FormField& field, 766 const webkit::forms::FormField& field,
765 const gfx::Rect& bounds, 767 const gfx::Rect& bounds,
766 const std::vector<string16>& suggestions) { 768 const std::vector<string16>& suggestions) {
767 if (external_delegate_) 769 if (external_delegate_)
768 external_delegate_->OnShowPasswordSuggestions(suggestions, field, bounds); 770 external_delegate_->OnShowPasswordSuggestions(suggestions, field, bounds);
769 } 771 }
770 772
773 void AutofillManager::OnSetDataList(const std::vector<string16>& values,
774 const std::vector<string16>& labels,
Ilya Sherman 2012/06/04 22:05:01 nit: Indent by one space fewer.
csharp 2012/06/06 14:06:52 Done.
775 const std::vector<string16>& icons,
776 const std::vector<int>& unique_ids) {
777 if (external_delegate_) {
778 external_delegate_->SetCurrentDataListValues(values,
779 labels,
780 icons,
781 unique_ids);
782 }
783 }
784
771 void AutofillManager::OnLoadedServerPredictions( 785 void AutofillManager::OnLoadedServerPredictions(
772 const std::string& response_xml) { 786 const std::string& response_xml) {
773 // Parse and store the server predictions. 787 // Parse and store the server predictions.
774 FormStructure::ParseQueryResponse(response_xml, 788 FormStructure::ParseQueryResponse(response_xml,
775 form_structures_.get(), 789 form_structures_.get(),
776 *metric_logger_); 790 *metric_logger_);
777 791
778 // If the corresponding flag is set, annotate forms with the predicted types. 792 // If the corresponding flag is set, annotate forms with the predicted types.
779 SendAutofillTypePredictions(form_structures_.get()); 793 SendAutofillTypePredictions(form_structures_.get());
780 } 794 }
(...skipping 603 matching lines...) Expand 10 before | Expand all | Expand 10 after
1384 *profile_guid = IDToGUID(profile_id); 1398 *profile_guid = IDToGUID(profile_id);
1385 } 1399 }
1386 1400
1387 void AutofillManager::UpdateInitialInteractionTimestamp( 1401 void AutofillManager::UpdateInitialInteractionTimestamp(
1388 const TimeTicks& interaction_timestamp) { 1402 const TimeTicks& interaction_timestamp) {
1389 if (initial_interaction_timestamp_.is_null() || 1403 if (initial_interaction_timestamp_.is_null() ||
1390 interaction_timestamp < initial_interaction_timestamp_) { 1404 interaction_timestamp < initial_interaction_timestamp_) {
1391 initial_interaction_timestamp_ = interaction_timestamp; 1405 initial_interaction_timestamp_ = interaction_timestamp;
1392 } 1406 }
1393 } 1407 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698