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

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: a couple more bugs 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 661c5049d0dbe36298da68fe8ed875f42366c96a..2f9ddf56c18f8812fc6a9d8981808b7224bee407 100644
--- a/chrome/browser/ui/views/autofill/autofill_dialog_views.cc
+++ b/chrome/browser/ui/views/autofill/autofill_dialog_views.cc
@@ -651,7 +651,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);
@@ -660,8 +661,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()) {

Powered by Google App Engine
This is Rietveld 408576698