| 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 FOCUS_CYCLER_H_ | 5 #ifndef FOCUS_CYCLER_H_ |
| 6 #define FOCUS_CYCLER_H_ | 6 #define FOCUS_CYCLER_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 class FocusCycler : public ui::AcceleratorTarget { | 24 class FocusCycler : public ui::AcceleratorTarget { |
| 25 public: | 25 public: |
| 26 enum Direction { | 26 enum Direction { |
| 27 FORWARD, | 27 FORWARD, |
| 28 BACKWARD | 28 BACKWARD |
| 29 }; | 29 }; |
| 30 | 30 |
| 31 FocusCycler(); | 31 FocusCycler(); |
| 32 virtual ~FocusCycler(); | 32 virtual ~FocusCycler(); |
| 33 | 33 |
| 34 // Returns the widget the FocusCycler is attempting to activate or NULL if |
| 35 // FocusCycler is not activating any widgets. |
| 36 const views::Widget* widget_activating() const { return widget_activating_; } |
| 37 |
| 34 // Add a widget to the focus cycle and set up accelerators. The widget needs | 38 // Add a widget to the focus cycle and set up accelerators. The widget needs |
| 35 // to have an AccessiblePaneView as the content view. | 39 // to have an AccessiblePaneView as the content view. |
| 36 void AddWidget(views::Widget* widget); | 40 void AddWidget(views::Widget* widget); |
| 37 | 41 |
| 38 // Move focus to the next widget. | 42 // Move focus to the next widget. |
| 39 void RotateFocus(Direction direction); | 43 void RotateFocus(Direction direction); |
| 40 | 44 |
| 41 // ui::AcceleratorTarget overrides | 45 // ui::AcceleratorTarget overrides |
| 42 virtual bool AcceleratorPressed(const ui::Accelerator& accelerator) OVERRIDE; | 46 virtual bool AcceleratorPressed(const ui::Accelerator& accelerator) OVERRIDE; |
| 43 virtual bool CanHandleAccelerators() const OVERRIDE; | 47 virtual bool CanHandleAccelerators() const OVERRIDE; |
| 44 | 48 |
| 45 private: | 49 private: |
| 46 std::vector<views::Widget*> widgets_; | 50 std::vector<views::Widget*> widgets_; |
| 47 | 51 |
| 52 // See description above getter. |
| 53 views::Widget* widget_activating_; |
| 54 |
| 48 DISALLOW_COPY_AND_ASSIGN(FocusCycler); | 55 DISALLOW_COPY_AND_ASSIGN(FocusCycler); |
| 49 }; | 56 }; |
| 50 | 57 |
| 51 } // namespace internal | 58 } // namespace internal |
| 52 | 59 |
| 53 } // namespace ash | 60 } // namespace ash |
| 54 | 61 |
| 55 #endif // FOCUS_CYCLER_H_ | 62 #endif // FOCUS_CYCLER_H_ |
| OLD | NEW |