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 #include "ash/focus_cycler.h" | 5 #include "ash/focus_cycler.h" |
6 | 6 |
7 #include "ash/shell.h" | 7 #include "ash/shell.h" |
8 #include "ash/wm/mru_window_tracker.h" | 8 #include "ash/wm/mru_window_tracker.h" |
9 #include "ash/wm/window_state.h" | 9 #include "ash/wm/window_state.h" |
10 #include "ash/wm/window_util.h" | 10 #include "ash/wm/window_util.h" |
11 #include "ui/aura/window.h" | 11 #include "ui/aura/window.h" |
12 #include "ui/views/accessible_pane_view.h" | 12 #include "ui/views/accessible_pane_view.h" |
13 #include "ui/views/focus/focus_search.h" | 13 #include "ui/views/focus/focus_search.h" |
14 #include "ui/views/widget/widget.h" | 14 #include "ui/views/widget/widget.h" |
15 #include "ui/wm/public/activation_client.h" | 15 #include "ui/wm/public/activation_client.h" |
16 | 16 |
17 namespace ash { | 17 namespace ash { |
18 | 18 |
19 namespace { | 19 namespace { |
20 | 20 |
21 bool HasFocusableWindow() { | 21 bool HasFocusableWindow() { |
22 return !MruWindowTracker::BuildWindowList(false).empty(); | 22 return !MruWindowTracker::BuildWindowList(false).empty(); |
23 } | 23 } |
24 | 24 |
25 } // namespace | 25 } // namespace |
26 | 26 |
27 namespace internal { | |
28 | |
29 FocusCycler::FocusCycler() : widget_activating_(NULL) { | 27 FocusCycler::FocusCycler() : widget_activating_(NULL) { |
30 } | 28 } |
31 | 29 |
32 FocusCycler::~FocusCycler() { | 30 FocusCycler::~FocusCycler() { |
33 } | 31 } |
34 | 32 |
35 void FocusCycler::AddWidget(views::Widget* widget) { | 33 void FocusCycler::AddWidget(views::Widget* widget) { |
36 widgets_.push_back(widget); | 34 widgets_.push_back(widget); |
37 } | 35 } |
38 | 36 |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 | 100 |
103 bool FocusCycler::FocusWidget(views::Widget* widget) { | 101 bool FocusCycler::FocusWidget(views::Widget* widget) { |
104 // Note: It is not necessary to set the focus directly to the pane since that | 102 // Note: It is not necessary to set the focus directly to the pane since that |
105 // will be taken care of by the widget activation. | 103 // will be taken care of by the widget activation. |
106 widget_activating_ = widget; | 104 widget_activating_ = widget; |
107 widget->Activate(); | 105 widget->Activate(); |
108 widget_activating_ = NULL; | 106 widget_activating_ = NULL; |
109 return widget->IsActive(); | 107 return widget->IsActive(); |
110 } | 108 } |
111 | 109 |
112 } // namespace internal | |
113 | |
114 } // namespace ash | 110 } // namespace ash |
OLD | NEW |