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

Unified Diff: ui/views/controls/button/text_button.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/bubble/bubble_delegate.cc ('k') | ui/views/controls/menu/menu_controller.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/controls/button/text_button.cc
diff --git a/ui/views/controls/button/text_button.cc b/ui/views/controls/button/text_button.cc
index c44b65ebfff84dabc03c821fa182fbb544871aa6..6677ff6a52127ca4cf72a84d23d55876218e0267 100644
--- a/ui/views/controls/button/text_button.cc
+++ b/ui/views/controls/button/text_button.cc
@@ -284,10 +284,15 @@ void TextButtonBase::SetIsDefault(bool is_default) {
if (is_default == is_default_)
return;
is_default_ = is_default;
- if (is_default_)
- AddAccelerator(ui::Accelerator(ui::VKEY_RETURN, ui::EF_NONE));
- else
- RemoveAccelerator(ui::Accelerator(ui::VKEY_RETURN, ui::EF_NONE));
+ if (is_default_) {
+ AddAccelerator(ui::Accelerator(ui::VKEY_RETURN,
+ ui::EF_NONE,
+ ui::ET_KEY_PRESSED));
+ } else {
+ RemoveAccelerator(ui::Accelerator(ui::VKEY_RETURN,
+ ui::EF_NONE,
+ ui::ET_KEY_PRESSED));
+ }
SchedulePaint();
}
« no previous file with comments | « ui/views/bubble/bubble_delegate.cc ('k') | ui/views/controls/menu/menu_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698