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.
5 #ifndef FOCUS_CYCLER_H_
6 #define FOCUS_CYCLER_H_
11 #include "base/compiler_specific.h"
12 #include "ui/base/accelerators/accelerator.h"
22 // This class handles moving focus between a set of widgets and the main browser
24 class FocusCycler
: public ui::AcceleratorTarget
{
32 virtual ~FocusCycler();
34 // Add a widget to the focus cycle and set up accelerators. The widget needs
35 // to have an AccessiblePaneView as the content view.
36 void AddWidget(views::Widget
* widget
);
38 // Move focus to the next widget.
39 void RotateFocus(Direction direction
);
41 // ui::AcceleratorTarget overrides
42 virtual bool AcceleratorPressed(const ui::Accelerator
& accelerator
) OVERRIDE
;
43 virtual bool CanHandleAccelerators() const OVERRIDE
;
46 std::vector
<views::Widget
*> widgets_
;
48 DISALLOW_COPY_AND_ASSIGN(FocusCycler
);
51 } // namespace internal
55 #endif // FOCUS_CYCLER_H_