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

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

Issue 2923723002: Avoid toggling app list if interrupted by mouse (Closed)
Patch Set: Rebase and refactor is_interrupted_by_mouse_event() to interrupted_by_mouse_event() 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/base/accelerators/accelerator_history.h » ('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..7bbddf426ea67985e9d33271639c250242259d30 100644
--- a/ui/base/accelerators/accelerator.cc
+++ b/ui/base/accelerators/accelerator.cc
@@ -42,19 +42,22 @@ Accelerator::Accelerator(KeyboardCode key_code,
KeyState key_state)
: key_code_(key_code),
key_state_(key_state),
- modifiers_(modifiers & kInterestingFlagsMask) {}
+ modifiers_(modifiers & kInterestingFlagsMask),
+ interrupted_by_mouse_event_(false) {}
Accelerator::Accelerator(const KeyEvent& key_event)
: key_code_(key_event.key_code()),
key_state_(key_event.type() == ET_KEY_PRESSED ? KeyState::PRESSED
: KeyState::RELEASED),
// |modifiers_| may include the repeat flag.
- modifiers_(key_event.flags() & kInterestingFlagsMask) {}
+ modifiers_(key_event.flags() & kInterestingFlagsMask),
+ interrupted_by_mouse_event_(false) {}
Accelerator::Accelerator(const Accelerator& accelerator) {
key_code_ = accelerator.key_code_;
key_state_ = accelerator.key_state_;
modifiers_ = accelerator.modifiers_;
+ interrupted_by_mouse_event_ = accelerator.interrupted_by_mouse_event_;
if (accelerator.platform_accelerator_)
platform_accelerator_ = accelerator.platform_accelerator_->CreateCopy();
}
@@ -72,6 +75,7 @@ Accelerator& Accelerator::operator=(const Accelerator& accelerator) {
key_code_ = accelerator.key_code_;
key_state_ = accelerator.key_state_;
modifiers_ = accelerator.modifiers_;
+ interrupted_by_mouse_event_ = accelerator.interrupted_by_mouse_event_;
if (accelerator.platform_accelerator_)
platform_accelerator_ = accelerator.platform_accelerator_->CreateCopy();
else
@@ -94,7 +98,8 @@ bool Accelerator::operator <(const Accelerator& rhs) const {
bool Accelerator::operator ==(const Accelerator& rhs) const {
return (key_code_ == rhs.key_code_) && (key_state_ == rhs.key_state_) &&
(MaskOutKeyEventFlags(modifiers_) ==
- MaskOutKeyEventFlags(rhs.modifiers_));
+ MaskOutKeyEventFlags(rhs.modifiers_)) &&
+ interrupted_by_mouse_event_ == rhs.interrupted_by_mouse_event_;
}
bool Accelerator::operator !=(const Accelerator& rhs) const {
« no previous file with comments | « ui/base/accelerators/accelerator.h ('k') | ui/base/accelerators/accelerator_history.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698