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

Unified Diff: ui/views/window/dialog_client_view.cc

Issue 10446010: wip: Add ui::EventType parameter. Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: wip - views_unittests Created 8 years, 7 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
« no previous file with comments | « ui/views/focus/focus_manager_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/window/dialog_client_view.cc
diff --git a/ui/views/window/dialog_client_view.cc b/ui/views/window/dialog_client_view.cc
index c5c50cd9621d3f2dbac5bd021ebffedc1673868b..0db7188cc9c5a102a1a26a919a26cefc5fe3e3f2 100644
--- a/ui/views/window/dialog_client_view.cc
+++ b/ui/views/window/dialog_client_view.cc
@@ -131,8 +131,11 @@ void DialogClientView::ShowDialogButtons() {
ok_button_->SetGroup(kButtonGroup);
if (is_default_button)
default_button_ = ok_button_;
- if (!(buttons & ui::DIALOG_BUTTON_CANCEL))
- ok_button_->AddAccelerator(ui::Accelerator(ui::VKEY_ESCAPE, ui::EF_NONE));
+ if (!(buttons & ui::DIALOG_BUTTON_CANCEL)) {
+ ok_button_->AddAccelerator(ui::Accelerator(ui::VKEY_ESCAPE,
+ ui::EF_NONE,
+ ui::ET_KEY_PRESSED));
+ }
AddChildView(ok_button_);
}
if (buttons & ui::DIALOG_BUTTON_CANCEL && !cancel_button_) {
@@ -155,7 +158,8 @@ void DialogClientView::ShowDialogButtons() {
is_default_button);
cancel_button_->SetGroup(kButtonGroup);
cancel_button_->AddAccelerator(ui::Accelerator(ui::VKEY_ESCAPE,
- ui::EF_NONE));
+ ui::EF_NONE,
+ ui::ET_KEY_PRESSED));
if (is_default_button)
default_button_ = ok_button_;
AddChildView(cancel_button_);
@@ -163,7 +167,9 @@ void DialogClientView::ShowDialogButtons() {
if (!buttons) {
// Register the escape key as an accelerator which will close the window
// if there are no dialog buttons.
- AddAccelerator(ui::Accelerator(ui::VKEY_ESCAPE, ui::EF_NONE));
+ AddAccelerator(ui::Accelerator(ui::VKEY_ESCAPE,
+ ui::EF_NONE,
+ ui::ET_KEY_PRESSED));
}
}
« no previous file with comments | « ui/views/focus/focus_manager_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698