Chromium Code Reviews| Index: chrome/browser/ui/input_window_dialog_win.cc |
| diff --git a/chrome/browser/ui/input_window_dialog_win.cc b/chrome/browser/ui/input_window_dialog_win.cc |
| index 5a10abb51ba0bb8528a37a333cf0f76214563abf..2a486758c2b29fde4eecc2c0b56a8e2d0a74ba3f 100644 |
| --- a/chrome/browser/ui/input_window_dialog_win.cc |
| +++ b/chrome/browser/ui/input_window_dialog_win.cc |
| @@ -133,15 +133,20 @@ string16 ContentView::GetDialogButtonLabel(ui::DialogButton button) const { |
| } |
| bool ContentView::IsDialogButtonEnabled(ui::DialogButton button) const { |
| - if (button == ui::DIALOG_BUTTON_OK && |
| - !delegate_->delegate()->IsValid(text_field_->text())) { |
| - return false; |
| + if (button == ui::DIALOG_BUTTON_OK) { |
| + InputWindowDialog::InputTexts texts; |
| + texts.push_back(text_field_->text()); |
| + if (!delegate_->delegate()->IsValid(texts)) { |
| + return false; |
| + } |
| } |
| return true; |
| } |
| bool ContentView::Accept() { |
| - delegate_->delegate()->InputAccepted(text_field_->text()); |
| + InputWindowDialog::InputTexts texts; |
| + texts.push_back(text_field_->text()); |
| + delegate_->delegate()->InputAccepted(texts); |
| return true; |
| } |
| @@ -251,12 +256,17 @@ void InputWindowDialogWin::Close() { |
| } |
| // static |
| -InputWindowDialog* InputWindowDialog::Create(gfx::NativeWindow parent, |
| - const string16& window_title, |
| - const string16& label, |
| - const string16& contents, |
| - Delegate* delegate, |
| - ButtonType type) { |
| - return new InputWindowDialogWin(parent, window_title, label, contents, |
| - delegate, type); |
| +InputWindowDialog* InputWindowDialog::Create( |
| + gfx::NativeWindow parent, |
| + const string16& window_title, |
| + const LabelContentsPairs& label_contents_pairs, |
| + Delegate* delegate, |
| + ButtonType type) { |
| + DCHECK_EQ(1U, label_contents_pairs.size()); |
|
flackr
2011/11/07 15:19:15
Can you use InputWindowDialogWebUI here too on --u
mazda
2011/11/08 11:24:24
Done.
|
| + return new InputWindowDialogWin(parent, |
| + window_title, |
| + label_contents_pairs[0].first, |
| + label_contents_pairs[0].second, |
| + delegate, |
| + type); |
| } |