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