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

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

Issue 11428071: support CC expiration dates in imperative autocomplete dialog. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: self review Created 8 years, 1 month 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
« no previous file with comments | « chrome/browser/ui/views/autofill/autofill_dialog_views.h ('k') | chrome/chrome_browser_ui.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 5d212bdf7cb4ef9c7636da6d1ed1643d92f359a4..8c8eb05083a5e61e44bd82238d6821a073f475e6 100644
--- a/chrome/browser/ui/views/autofill/autofill_dialog_views.cc
+++ b/chrome/browser/ui/views/autofill/autofill_dialog_views.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/ui/views/autofill/autofill_dialog_views.h"
+#include "base/string_number_conversions.h"
#include "base/utf_string_conversions.h"
#include "chrome/browser/ui/autofill/autofill_dialog_controller.h"
#include "chrome/browser/ui/views/constrained_window_views.h"
@@ -105,6 +106,13 @@ void AutofillDialogViews::GetUserInput(DialogSection section,
it != group->textfields.end(); ++it) {
output->insert(std::make_pair(it->first, it->second->text()));
}
+ for (ComboboxMap::iterator it = group->comboboxes.begin();
+ it != group->comboboxes.end(); ++it) {
+ views::Combobox* combobox = it->second;
+ output->insert(std::make_pair(
+ it->first,
+ combobox->model()->GetItemAt(combobox->selected_index())));
+ }
}
bool AutofillDialogViews::UseBillingForShipping() {
@@ -148,14 +156,6 @@ bool AutofillDialogViews::UseChromeStyle() const {
return true;
}
-ui::ModalType AutofillDialogViews::GetModalType() const {
-#if defined(USE_ASH)
- return ui::MODAL_TYPE_CHILD;
-#else
- return views::WidgetDelegate::GetModalType();
-#endif
-}
-
bool AutofillDialogViews::Cancel() {
return true;
}
@@ -300,6 +300,7 @@ views::View* AutofillDialogViews::CreateInputsContainer(DialogSection section) {
views::View* AutofillDialogViews::InitInputsView(DialogSection section) {
const DetailInputs& inputs = controller_->RequestedFieldsForSection(section);
TextfieldMap* textfields = &GroupForSection(section)->textfields;
+ ComboboxMap* comboboxes = &GroupForSection(section)->comboboxes;
views::View* view = new views::View();
views::GridLayout* layout = new views::GridLayout(view);
@@ -335,11 +336,23 @@ views::View* AutofillDialogViews::InitInputsView(DialogSection section) {
0,
0);
- views::Textfield* field = new views::Textfield();
- field->set_placeholder_text(ASCIIToUTF16(input.placeholder_text));
- field->SetText(input.starting_value);
- textfields->insert(std::make_pair(&input, field));
- layout->AddView(field);
+ ui::ComboboxModel* input_model =
+ controller_->ComboboxModelForAutofillType(input.type);
+ // TODO(estade): TextFields and Comboboxes need to be the same height.
sky 2012/11/29 16:30:24 You should be able to do that by specifying a vert
Evan Stade 2012/11/29 19:50:52 yea, but that would only fix comboboxes and textfi
+ if (input_model) {
+ views::Combobox* combobox = new views::Combobox(input_model);
+ int starting_value;
+ if (base::StringToInt(input.starting_value, &starting_value))
+ combobox->SetSelectedIndex(starting_value);
+ comboboxes->insert(std::make_pair(&input, combobox));
+ layout->AddView(combobox);
+ } else {
+ views::Textfield* field = new views::Textfield();
+ field->set_placeholder_text(ASCIIToUTF16(input.placeholder_text));
+ field->SetText(input.starting_value);
+ textfields->insert(std::make_pair(&input, field));
+ layout->AddView(field);
+ }
}
return view;
« no previous file with comments | « chrome/browser/ui/views/autofill/autofill_dialog_views.h ('k') | chrome/chrome_browser_ui.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698