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

Unified Diff: chrome/browser/ui/input_window_dialog_win.cc

Issue 8438037: Change 'Add Page' to show a simple input dialog with --use-more-webui. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Fix build break Created 9 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
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);
}

Powered by Google App Engine
This is Rietveld 408576698