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

Unified Diff: ash/accelerators/accelerator_controller.h

Issue 582143004: Introduce "Preferred" accelerators (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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
Index: ash/accelerators/accelerator_controller.h
diff --git a/ash/accelerators/accelerator_controller.h b/ash/accelerators/accelerator_controller.h
index 6b7ddb9ba1401ebefa23148352d4cde1c6699242..a518b19608b83dd2269f6d1cc20945bf87abc777 100644
--- a/ash/accelerators/accelerator_controller.h
+++ b/ash/accelerators/accelerator_controller.h
@@ -77,8 +77,14 @@ class ASH_EXPORT AcceleratorController : public ui::AcceleratorTarget {
// Returns true if the |accelerator| is registered.
bool IsRegistered(const ui::Accelerator& accelerator) const;
- // Returns true if the |accelerator| is one of the |reserved_actions_|.
- bool IsReservedAccelerator(const ui::Accelerator& accelerator) const;
+ // Returns true if the |accelerator| is preferred. A preferred accelerator
+ // is handled before being passed to an window/web contents, unless
+ // the window is in fullscreen state.
James Cook 2014/09/19 16:13:15 nice comments
+ bool IsPreferred(const ui::Accelerator& accelerator) const;
+
+ // Returns true if the |accelerator| is reserved. A reserved accelerator
+ // is always handled and will never passedto an window/web contents.
James Cook 2014/09/19 16:13:15 nit: "never be passed to"
oshima 2014/09/19 18:55:19 Done.
+ bool IsReserved(const ui::Accelerator& accelerator) const;
// Performs the specified action. The |accelerator| may provide additional
// data the action needs. Returns whether an action was performed
@@ -165,6 +171,8 @@ class ASH_EXPORT AcceleratorController : public ui::AcceleratorTarget {
// Actions allowed when a modal window is up.
std::set<int> actions_allowed_at_modal_window_;
// Reserved actions. See accelerator_table.h for details.
James Cook 2014/09/19 16:13:14 nit: Reserved -> Preferred
oshima 2014/09/19 18:55:19 Done.
+ std::set<int> preferred_actions_;
+ // Reserved actions. See accelerator_table.h for details.
std::set<int> reserved_actions_;
// Actions which will not be repeated while holding the accelerator key.
std::set<int> nonrepeatable_actions_;
« no previous file with comments | « no previous file | ash/accelerators/accelerator_controller.cc » ('j') | ash/accelerators/accelerator_controller_unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698