OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 APP_MENUS_ACCELERATOR_H_ | 5 #ifndef APP_MENUS_ACCELERATOR_H_ |
6 #define APP_MENUS_ACCELERATOR_H_ | 6 #define APP_MENUS_ACCELERATOR_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/keyboard_codes.h" | 9 #include "base/keyboard_codes.h" |
10 | 10 |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 } | 61 } |
62 | 62 |
63 protected: | 63 protected: |
64 // The keycode (VK_...). | 64 // The keycode (VK_...). |
65 base::KeyboardCode key_code_; | 65 base::KeyboardCode key_code_; |
66 | 66 |
67 // The state of the Shift/Ctrl/Alt keys (platform-dependent). | 67 // The state of the Shift/Ctrl/Alt keys (platform-dependent). |
68 int modifiers_; | 68 int modifiers_; |
69 }; | 69 }; |
70 | 70 |
71 // Since acclerator code is one of the few things that can't be cross platform | |
72 // in the chrome UI, separate out just the GetAcceleratorForCommandId() from | |
73 // the menu delegates. | |
74 class AcceleratorProvider { | |
75 public: | |
76 virtual ~AcceleratorProvider() {} | |
77 | |
78 // Gets the accelerator for the specified command id. Returns true if the | |
79 // command id has a valid accelerator, false otherwise. | |
80 virtual bool GetAcceleratorForCommandId( | |
81 int command_id, | |
82 menus::Accelerator* accelerator) = 0; | |
83 }; | |
84 | |
85 } | 71 } |
86 | 72 |
87 #endif // APP_MENUS_ACCELERATOR_H_ | 73 #endif // APP_MENUS_ACCELERATOR_H_ |
88 | 74 |
OLD | NEW |