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

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

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 | « ash/accelerators/accelerator_filter_unittest.cc ('k') | ui/base/accelerators/accelerator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/base/accelerators/accelerator.h
diff --git a/ui/base/accelerators/accelerator.h b/ui/base/accelerators/accelerator.h
index f5ee41709ccf41896dd6f2c49ebe26d79c0fa52d..3d6b42218b19ea89307efde43782c25607176891 100644
--- a/ui/base/accelerators/accelerator.h
+++ b/ui/base/accelerators/accelerator.h
@@ -89,6 +89,14 @@ class UI_BASE_EXPORT Accelerator {
return platform_accelerator_.get();
}
+ void set_interrupted_by_mouse_event(bool interrupted_by_mouse_event) {
+ interrupted_by_mouse_event_ = interrupted_by_mouse_event;
+ }
+
+ bool interrupted_by_mouse_event() const {
+ return interrupted_by_mouse_event_;
+ }
+
private:
// The keycode (VK_...).
KeyboardCode key_code_;
@@ -102,6 +110,13 @@ class UI_BASE_EXPORT Accelerator {
// TODO: this is only used in Mac code and should be removed from here.
// http://crbug.com/702823.
std::unique_ptr<PlatformAccelerator> platform_accelerator_;
+
+ // Whether the accelerator is interrupted by a mouse press/release. This is
+ // optionally used by AcceleratorController. Even this is set to true, the
+ // accelerator may still be handled successfully. (Currently only
+ // TOGGLE_APP_LIST is disabled when mouse press/release occurs between
+ // search key down and up. See crbug.com/665897)
+ bool interrupted_by_mouse_event_;
};
// An interface that classes that want to register for keyboard accelerators
« no previous file with comments | « ash/accelerators/accelerator_filter_unittest.cc ('k') | ui/base/accelerators/accelerator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698