Chromium Code Reviews| Index: ash/accelerators/accelerator_controller.h |
| diff --git a/ash/accelerators/accelerator_controller.h b/ash/accelerators/accelerator_controller.h |
| index 374286e50dd15b9c637cbfd84d5fe8d832aceddf..0cf77fbe84b74a290d88fc671f20b3b1da55ebb4 100644 |
| --- a/ash/accelerators/accelerator_controller.h |
| +++ b/ash/accelerators/accelerator_controller.h |
| @@ -38,6 +38,19 @@ class ASH_EXPORT AcceleratorController : public ui::AcceleratorTarget { |
| AcceleratorController(); |
| virtual ~AcceleratorController(); |
| + // A list of possible ways in which an accelerator should be restricted before |
| + // processing. |
|
Finnur
2014/06/26 10:37:35
I think we should flesh out this comment a little
David Tseng
2014/06/27 00:49:11
It is a non-enforced restriction at the moment.
A
|
| + enum AcceleratorProcessRestriction { |
|
Finnur
2014/06/26 10:37:35
nit: Process is ambiguous. Processing?
David Tseng
2014/06/27 00:49:10
Yup :); getting wordy, but it does make more sense
|
| + // 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 +84,11 @@ class ASH_EXPORT AcceleratorController : public ui::AcceleratorTarget { |
| bool PerformAction(int action, |
| const ui::Accelerator& accelerator); |
| + // Gets any restriction for the given accelerator and action. |
|
Finnur
2014/06/26 10:37:35
nit: "Returns which restriction applies to a given
David Tseng
2014/06/27 00:49:11
Done.
|
| + AcceleratorProcessRestriction GetAcceleratorProcessRestriction( |
|
Finnur
2014/06/26 10:37:35
ditto: Ambiguous word "Process".
David Tseng
2014/06/27 00:49:10
Done, everywhere.
|
| + int action, |
| + ui::Accelerator accelerator); |
|
Finnur
2014/06/26 10:37:35
const ui::Accelerator& ?
David Tseng
2014/06/27 00:49:10
Done.
|
| + |
| // Overridden from ui::AcceleratorTarget: |
| virtual bool AcceleratorPressed(const ui::Accelerator& accelerator) OVERRIDE; |
| virtual bool CanHandleAccelerators() const OVERRIDE; |