| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_UI_VIEWS_ACCELERATOR_TABLE_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_ACCELERATOR_TABLE_H_ |
| 6 #define CHROME_BROWSER_UI_VIEWS_ACCELERATOR_TABLE_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_ACCELERATOR_TABLE_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "chrome/browser/ui/views/chrome_views_export.h" | 10 #include "chrome/browser/ui/views/chrome_views_export.h" |
| 11 #include "ui/events/keycodes/keyboard_codes.h" | 11 #include "ui/events/keycodes/keyboard_codes.h" |
| 12 | 12 |
| 13 namespace ui { | 13 namespace ui { |
| 14 class Accelerator; | 14 class Accelerator; |
| 15 } | 15 } |
| 16 | 16 |
| 17 // This contains the list of accelerators for the Aura implementation. | 17 // This contains the list of accelerators for the Aura implementation. |
| 18 namespace chrome { | 18 namespace chrome { |
| 19 | 19 |
| 20 struct AcceleratorMapping { | 20 struct AcceleratorMapping { |
| 21 ui::KeyboardCode keycode; | 21 ui::KeyboardCode keycode; |
| 22 int modifiers; | 22 int modifiers; |
| 23 int command_id; | 23 int command_id; |
| 24 }; | 24 }; |
| 25 | 25 |
| 26 // Returns a list of accelerator mapping information for accelerators | 26 // Returns a list of accelerator mapping information for accelerators |
| 27 // handled by Chrome but excluding accelerators handled by Ash. | 27 // handled by Chrome but excluding accelerators handled by Ash. |
| 28 CHROME_VIEWS_EXPORT std::vector<AcceleratorMapping> GetAcceleratorList(); | 28 CHROME_VIEWS_EXPORT std::vector<AcceleratorMapping> GetAcceleratorList(); |
| 29 | 29 |
| 30 // Returns a full list of accelerator mapping without platform-specific |
| 31 // post-filtering. |
| 32 CHROME_VIEWS_EXPORT std::vector<AcceleratorMapping> |
| 33 GetUnfilteredAcceleratorListForTesting(); |
| 34 |
| 30 // Returns true on Ash and if the command id has an associated accelerator which | 35 // Returns true on Ash and if the command id has an associated accelerator which |
| 31 // is handled by Ash. If the return is true the accelerator is returned via the | 36 // is handled by Ash. If the return is true the accelerator is returned via the |
| 32 // second argument. | 37 // second argument. |
| 33 CHROME_VIEWS_EXPORT bool GetAshAcceleratorForCommandId( | 38 CHROME_VIEWS_EXPORT bool GetAshAcceleratorForCommandId( |
| 34 int command_id, | 39 int command_id, |
| 35 ui::Accelerator* accelerator); | 40 ui::Accelerator* accelerator); |
| 36 | 41 |
| 37 // Returns true if the command id has an associated standard | 42 // Returns true if the command id has an associated standard |
| 38 // accelerator like cut, copy and paste. If the return is true the | 43 // accelerator like cut, copy and paste. If the return is true the |
| 39 // accelerator is returned via the second argument. | 44 // accelerator is returned via the second argument. |
| 40 CHROME_VIEWS_EXPORT bool GetStandardAcceleratorForCommandId( | 45 CHROME_VIEWS_EXPORT bool GetStandardAcceleratorForCommandId( |
| 41 int command_id, | 46 int command_id, |
| 42 ui::Accelerator* accelerator); | 47 ui::Accelerator* accelerator); |
| 43 | 48 |
| 44 // Returns true if the command identified by |command_id| should be executed | 49 // Returns true if the command identified by |command_id| should be executed |
| 45 // repeatedly while its accelerator keys are held down. | 50 // repeatedly while its accelerator keys are held down. |
| 46 CHROME_VIEWS_EXPORT bool IsCommandRepeatable(int command_id); | 51 CHROME_VIEWS_EXPORT bool IsCommandRepeatable(int command_id); |
| 47 | 52 |
| 48 } // namespace chrome | 53 } // namespace chrome |
| 49 | 54 |
| 50 #endif // CHROME_BROWSER_UI_VIEWS_ACCELERATOR_TABLE_H_ | 55 #endif // CHROME_BROWSER_UI_VIEWS_ACCELERATOR_TABLE_H_ |
| OLD | NEW |