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

Unified Diff: chrome/browser/ui/views/autofill/autofill_dialog_views.cc

Issue 13607006: rAc: don't clobber user input when accepting autofill popup suggestion (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: merge Created 7 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/views/autofill/autofill_dialog_views.cc
diff --git a/chrome/browser/ui/views/autofill/autofill_dialog_views.cc b/chrome/browser/ui/views/autofill/autofill_dialog_views.cc
index a73c469be9ce994f6b4438891639dac506189fe7..dbc0ad95001ec3cca39302c04ba7779c439d298a 100644
--- a/chrome/browser/ui/views/autofill/autofill_dialog_views.cc
+++ b/chrome/browser/ui/views/autofill/autofill_dialog_views.cc
@@ -652,7 +652,8 @@ void AutofillDialogViews::UpdateNotificationArea() {
ContentsPreferredSizeChanged();
}
-void AutofillDialogViews::UpdateSection(DialogSection section) {
+void AutofillDialogViews::UpdateSection(DialogSection section,
+ UserInputAction action) {
const DetailInputs& updated_inputs =
controller_->RequestedFieldsForSection(section);
DetailsGroup* group = GroupForSection(section);
@@ -661,8 +662,12 @@ void AutofillDialogViews::UpdateSection(DialogSection section) {
iter != updated_inputs.end(); ++iter) {
const DetailInput& input = *iter;
TextfieldMap::iterator text_mapping = group->textfields.find(&input);
- if (text_mapping != group->textfields.end())
+
+ if (text_mapping != group->textfields.end() &&
+ (text_mapping->second->textfield()->text().empty() ||
+ action == CLEAR_USER_INPUT)) {
text_mapping->second->textfield()->SetText(iter->initial_value);
+ }
ComboboxMap::iterator combo_mapping = group->comboboxes.find(&input);
if (combo_mapping != group->comboboxes.end()) {
« no previous file with comments | « chrome/browser/ui/views/autofill/autofill_dialog_views.h ('k') | ui/views/controls/combobox/native_combobox_views.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698