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 FOCUS_CYCLER_H_ | |
6 #define FOCUS_CYCLER_H_ | |
7 #pragma once | |
8 | |
9 #include "ash/accelerators/accelerator_controller.h" | |
sky
2012/01/31 16:38:15
Include ui/base/accelerators/accelerator instead.
Zachary Kuznia
2012/01/31 17:57:42
Done.
| |
10 | |
11 #include <vector> | |
sky
2012/01/31 16:38:15
vector should be the first include.
Zachary Kuznia
2012/01/31 17:57:42
Done.
| |
12 | |
13 namespace views { | |
14 class Widget; | |
15 } // namespace views | |
16 | |
17 namespace ash { | |
18 | |
sky
2012/01/31 16:38:15
If this class isn't needed outside of ash, put it
Zachary Kuznia
2012/01/31 17:57:42
Done.
| |
19 // This class handles moving focus between a set of widgets and the main browser | |
20 // window. | |
21 class FocusCycler : public ui::AcceleratorTarget { | |
22 public: | |
23 FocusCycler(); | |
24 ~FocusCycler(); | |
sky
2012/01/31 16:38:15
virtual
Zachary Kuznia
2012/01/31 17:57:42
Done.
| |
25 | |
26 // Add a widget to the focus cycle and set up accelerators. The widget needs | |
27 // to have an AccessiblePaneView as the content view. | |
28 void AddWidget(views::Widget* widget); | |
29 | |
30 // Move focus to the next widget. | |
31 void RotateFocus(bool forwards); | |
sky
2012/01/31 16:38:15
Use an enum to make it clear what true/value mean.
Zachary Kuznia
2012/01/31 17:57:42
Done.
| |
32 | |
33 // ui::AcceleratorTarget overrides | |
34 virtual bool AcceleratorPressed(const ui::Accelerator& accelerator) OVERRIDE; | |
35 virtual bool CanHandleAccelerators() const OVERRIDE; | |
36 | |
37 private: | |
38 ui::Accelerator ctrl_forward_key_; | |
sky
2012/01/31 16:38:15
Do these really need to exist as members? Can AddW
Zachary Kuznia
2012/01/31 17:57:42
Done.
| |
39 ui::Accelerator ctrl_back_key_; | |
40 | |
41 std::vector<views::Widget*> widgets_; | |
42 | |
43 DISALLOW_COPY_AND_ASSIGN(FocusCycler); | |
44 }; | |
45 | |
46 } // namespace ash | |
47 | |
48 #endif // FOCUS_CYCLER_H_ | |
OLD | NEW |