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

Unified Diff: ui/base/accelerators/accelerator.cc

Issue 2953643002: Replaced synthetic MouseEvent in CustomButton::AcceleratorPressed() with just an Event. (Closed)
Patch Set: Removed unnecessary local variables. Created 3 years, 5 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/base/accelerators/accelerator.h ('k') | ui/views/controls/button/custom_button.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/base/accelerators/accelerator.cc
diff --git a/ui/base/accelerators/accelerator.cc b/ui/base/accelerators/accelerator.cc
index 8b8d14e1a5fbee1cef1c0cbd95b1d9f6ac8cecbb..837c514c22548e24205f745f33e36fae462eec1f 100644
--- a/ui/base/accelerators/accelerator.cc
+++ b/ui/base/accelerators/accelerator.cc
@@ -67,6 +67,13 @@ int Accelerator::MaskOutKeyEventFlags(int flags) {
return flags & kModifierMask;
}
+KeyEvent Accelerator::ToKeyEvent() const {
+ return KeyEvent(key_state() == Accelerator::KeyState::PRESSED
+ ? ET_KEY_PRESSED
+ : ET_KEY_RELEASED,
+ key_code(), modifiers());
+}
+
Accelerator& Accelerator::operator=(const Accelerator& accelerator) {
if (this != &accelerator) {
key_code_ = accelerator.key_code_;
« no previous file with comments | « ui/base/accelerators/accelerator.h ('k') | ui/views/controls/button/custom_button.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698