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 UI_VIEWS_FOCUS_FOCUS_MANAGER_DELEGATE_H_ | 5 #ifndef UI_VIEWS_FOCUS_FOCUS_MANAGER_DELEGATE_H_ |
6 #define UI_VIEWS_FOCUS_FOCUS_MANAGER_DELEGATE_H_ | 6 #define UI_VIEWS_FOCUS_FOCUS_MANAGER_DELEGATE_H_ |
7 | 7 |
8 #include "ui/views/views_export.h" | 8 #include "ui/views/views_export.h" |
9 | 9 |
10 namespace ui { | 10 namespace ui { |
11 class Accelerator; | 11 class Accelerator; |
12 class AcceleratorTarget; | |
13 } | 12 } |
14 | 13 |
15 namespace views { | 14 namespace views { |
16 | 15 |
17 // Delegate interface for views::FocusManager. | 16 // Delegate interface for views::FocusManager. |
18 class VIEWS_EXPORT FocusManagerDelegate { | 17 class VIEWS_EXPORT FocusManagerDelegate { |
19 public: | 18 public: |
20 virtual ~FocusManagerDelegate() {} | 19 virtual ~FocusManagerDelegate() {} |
21 | 20 |
22 // Activate the target associated with the specified accelerator. | 21 // Activate the target associated with the specified accelerator. |
23 // First, AcceleratorPressed handler of the most recently registered target | 22 // First, AcceleratorPressed handler of the most recently registered target |
24 // is called, and if that handler processes the event (i.e. returns true), | 23 // is called, and if that handler processes the event (i.e. returns true), |
25 // this method immediately returns. If not, we do the same thing on the next | 24 // this method immediately returns. If not, we do the same thing on the next |
26 // target, and so on. | 25 // target, and so on. |
27 // Returns true if an accelerator was activated. | 26 // Returns true if an accelerator was activated. |
28 virtual bool ProcessAccelerator(const ui::Accelerator& accelerator) = 0; | 27 virtual bool ProcessAccelerator(const ui::Accelerator& accelerator) = 0; |
29 }; | 28 }; |
30 | 29 |
31 } // namespace views | 30 } // namespace views |
32 | 31 |
33 #endif // UI_VIEWS_FOCUS_FOCUS_MANAGER_DELEGATE_H_ | 32 #endif // UI_VIEWS_FOCUS_FOCUS_MANAGER_DELEGATE_H_ |
OLD | NEW |