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/shell_delegate.h" | 8 #include "ash/shell_delegate.h" |
9 #include "ui/views/widget/widget.h" | 9 #include "ui/views/widget/widget.h" |
10 #include "ui/views/focus/focus_search.h" | 10 #include "ui/views/focus/focus_search.h" |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 index = ((index - 1) + count) % count; | 57 index = ((index - 1) + count) % count; |
58 | 58 |
59 // Ensure that we don't loop more than once. | 59 // Ensure that we don't loop more than once. |
60 if (index == start_index) | 60 if (index == start_index) |
61 break; | 61 break; |
62 | 62 |
63 if (index == browser_index) { | 63 if (index == browser_index) { |
64 // Activate the browser window. | 64 // Activate the browser window. |
65 const std::vector<aura::Window*>& windows = | 65 const std::vector<aura::Window*>& windows = |
66 Shell::GetInstance()->delegate()->GetCycleWindowList( | 66 Shell::GetInstance()->delegate()->GetCycleWindowList( |
67 ShellDelegate::SOURCE_LAUNCHER, ShellDelegate::ORDER_MRU); | 67 ShellDelegate::SOURCE_LAUNCHER); |
68 if (!windows.empty()) { | 68 if (!windows.empty()) { |
69 aura::client::GetActivationClient(Shell::GetRootWindow())-> | 69 aura::client::GetActivationClient(Shell::GetRootWindow())-> |
70 ActivateWindow(windows[0]); | 70 ActivateWindow(windows[0]); |
71 break; | 71 break; |
72 } | 72 } |
73 } else { | 73 } else { |
74 views::Widget* widget = widgets_[index]; | 74 views::Widget* widget = widgets_[index]; |
75 | 75 |
76 views::AccessiblePaneView* view = | 76 views::AccessiblePaneView* view = |
77 static_cast<views::AccessiblePaneView*>(widget->GetContentsView()); | 77 static_cast<views::AccessiblePaneView*>(widget->GetContentsView()); |
(...skipping 21 matching lines...) Expand all Loading... |
99 } | 99 } |
100 } | 100 } |
101 | 101 |
102 bool FocusCycler::CanHandleAccelerators() const { | 102 bool FocusCycler::CanHandleAccelerators() const { |
103 return true; | 103 return true; |
104 } | 104 } |
105 | 105 |
106 } // namespace internal | 106 } // namespace internal |
107 | 107 |
108 } // namespace ash | 108 } // namespace ash |
OLD | NEW |