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

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: 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 9c2f43e80314fd97c0c18dacd3025a73f7b0d08e..3e28105307d601670d2386fbdfb9650bd73531e0 100644
--- a/chrome/browser/ui/input_window_dialog_win.cc
+++ b/chrome/browser/ui/input_window_dialog_win.cc
@@ -119,15 +119,20 @@ ContentView::ContentView(InputWindowDialogWin* delegate)
bool ContentView::IsDialogButtonEnabled(
ui::MessageBoxFlags::DialogButton button) const {
- if (button == ui::MessageBoxFlags::DIALOGBUTTON_OK &&
- !delegate_->delegate()->IsValid(text_field_->text())) {
- return false;
+ if (button == ui::MessageBoxFlags::DIALOGBUTTON_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;
}
@@ -235,12 +240,16 @@ 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);
+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());
+ return new InputWindowDialogWin(parent,
+ window_title,
+ label_contents_pairs[0].first,
+ label_contents_pairs[0].second,
+ delegate);
}

Powered by Google App Engine
This is Rietveld 408576698