Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(16)

Side by Side Diff: ash/focus_cycler.h

Issue 2075923002: mash: Convert FocusCycler to wm common types and move to //ash/common (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ash/common/wm_window.h ('k') | ash/focus_cycler.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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
8 #include <vector>
9
10 #include "ash/ash_export.h"
11 #include "base/compiler_specific.h"
12 #include "base/macros.h"
13
14 namespace views {
15 class Widget;
16 } // namespace views
17
18 namespace ash {
19
20 // This class handles moving focus between a set of widgets and the main browser
21 // window.
22 class ASH_EXPORT FocusCycler {
23 public:
24 enum Direction {
25 FORWARD,
26 BACKWARD
27 };
28
29 FocusCycler();
30 ~FocusCycler();
31
32 // Returns the widget the FocusCycler is attempting to activate or NULL if
33 // FocusCycler is not activating any widgets.
34 const views::Widget* widget_activating() const { return widget_activating_; }
35
36 // Add a widget to the focus cycle. The widget needs to have an
37 // AccessiblePaneView as the content view.
38 void AddWidget(views::Widget* widget);
39
40 // Remove a widget from the focus cycle.
41 void RemoveWidget(views::Widget* widget);
42
43 // Move focus to the next widget.
44 void RotateFocus(Direction direction);
45
46 // Moves focus the specified widget. Returns true if the widget was activated.
47 bool FocusWidget(views::Widget* widget);
48
49 private:
50 std::vector<views::Widget*> widgets_;
51
52 // See description above getter.
53 views::Widget* widget_activating_;
54
55 DISALLOW_COPY_AND_ASSIGN(FocusCycler);
56 };
57
58 } // namespace ash
59
60 #endif // FOCUS_CYCLER_H_
OLDNEW
« no previous file with comments | « ash/common/wm_window.h ('k') | ash/focus_cycler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698