Index: ash/accelerators/accelerator_controller.h |
diff --git a/ash/accelerators/accelerator_controller.h b/ash/accelerators/accelerator_controller.h |
index 374286e50dd15b9c637cbfd84d5fe8d832aceddf..bc36bf9261dec348d726fe2eb731a625a4a01c23 100644 |
--- a/ash/accelerators/accelerator_controller.h |
+++ b/ash/accelerators/accelerator_controller.h |
@@ -38,6 +38,21 @@ class ASH_EXPORT AcceleratorController : public ui::AcceleratorTarget { |
AcceleratorController(); |
virtual ~AcceleratorController(); |
+ // A list of possible ways in which an accelerator should be restricted before |
+ // processing. Any target registered with this controller should respect |
+ // restrictions by calling |GetAcceleratorProcessingRestriction| during |
+ // processing. |
+ enum AcceleratorProcessingRestriction { |
+ // Process the accelerator normally. |
+ RESTRICTION_NONE, |
+ |
+ // Don't process the accelerator. |
+ RESTRICTION_PREVENT_PROCESSING, |
+ |
+ // Don't process the accelerator and prevent propagation to other targets. |
+ RESTRICTION_PREVENT_PROCESSING_AND_PROPAGATION |
+ }; |
+ |
// Registers a global keyboard accelerator for the specified target. If |
// multiple targets are registered for an accelerator, a target registered |
// later has higher priority. |
@@ -71,6 +86,11 @@ class ASH_EXPORT AcceleratorController : public ui::AcceleratorTarget { |
bool PerformAction(int action, |
const ui::Accelerator& accelerator); |
+ // Returns which restriction applies for the given accelerator and action. |
+ AcceleratorProcessingRestriction GetAcceleratorProcessingRestriction( |
+ int action, |
+ const ui::Accelerator& accelerator); |
+ |
// Overridden from ui::AcceleratorTarget: |
virtual bool AcceleratorPressed(const ui::Accelerator& accelerator) OVERRIDE; |
virtual bool CanHandleAccelerators() const OVERRIDE; |