| 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().empty(); |
| 23 } | 23 } |
| 24 | 24 |
| 25 } // namespace | 25 } // namespace |
| 26 | 26 |
| 27 FocusCycler::FocusCycler() : widget_activating_(NULL) { | 27 FocusCycler::FocusCycler() : widget_activating_(NULL) { |
| 28 } | 28 } |
| 29 | 29 |
| 30 FocusCycler::~FocusCycler() { | 30 FocusCycler::~FocusCycler() { |
| 31 } | 31 } |
| 32 | 32 |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 bool FocusCycler::FocusWidget(views::Widget* widget) { | 101 bool FocusCycler::FocusWidget(views::Widget* widget) { |
| 102 // 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 |
| 103 // will be taken care of by the widget activation. | 103 // will be taken care of by the widget activation. |
| 104 widget_activating_ = widget; | 104 widget_activating_ = widget; |
| 105 widget->Activate(); | 105 widget->Activate(); |
| 106 widget_activating_ = NULL; | 106 widget_activating_ = NULL; |
| 107 return widget->IsActive(); | 107 return widget->IsActive(); |
| 108 } | 108 } |
| 109 | 109 |
| 110 } // namespace ash | 110 } // namespace ash |
| OLD | NEW |