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" |
11 #include "ui/aura/window.h" | 11 #include "ui/aura/window.h" |
12 #include "ui/aura/client/activation_client.h" | 12 #include "ui/aura/client/activation_client.h" |
13 | 13 |
14 #include "ui/views/accessible_pane_view.h" | 14 #include "ui/views/accessible_pane_view.h" |
15 | 15 |
16 namespace ash { | 16 namespace ash { |
17 | 17 |
18 namespace internal { | 18 namespace internal { |
19 | 19 |
20 FocusCycler::FocusCycler() : widget_activating_(NULL) { | 20 FocusCycler::FocusCycler() : widget_activating_(NULL) { |
21 } | 21 } |
22 | 22 |
23 FocusCycler::~FocusCycler() { | 23 FocusCycler::~FocusCycler() { |
24 } | 24 } |
25 | 25 |
26 void FocusCycler::AddWidget(views::Widget* widget) { | 26 void FocusCycler::AddWidget(views::Widget* widget) { |
27 widgets_.push_back(widget); | 27 widgets_.push_back(widget); |
28 | 28 |
29 widget->GetFocusManager()->RegisterAccelerator( | 29 widget->GetFocusManager()->RegisterAccelerator( |
30 ui::Accelerator(ui::VKEY_F2, false, true, false), this); | 30 ui::Accelerator(ui::VKEY_F2, false, true, false), false, this); |
31 widget->GetFocusManager()->RegisterAccelerator( | 31 widget->GetFocusManager()->RegisterAccelerator( |
32 ui::Accelerator(ui::VKEY_F1, false, true, false), this); | 32 ui::Accelerator(ui::VKEY_F1, false, true, false), false, this); |
33 } | 33 } |
34 | 34 |
35 void FocusCycler::RotateFocus(Direction direction) { | 35 void FocusCycler::RotateFocus(Direction direction) { |
36 int index = 0; | 36 int index = 0; |
37 int count = static_cast<int>(widgets_.size()); | 37 int count = static_cast<int>(widgets_.size()); |
38 int browser_index = count; | 38 int browser_index = count; |
39 | 39 |
40 for (; index < count; ++index) { | 40 for (; index < count; ++index) { |
41 if (widgets_[index]->IsActive()) | 41 if (widgets_[index]->IsActive()) |
42 break; | 42 break; |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 } | 94 } |
95 } | 95 } |
96 | 96 |
97 bool FocusCycler::CanHandleAccelerators() const { | 97 bool FocusCycler::CanHandleAccelerators() const { |
98 return true; | 98 return true; |
99 } | 99 } |
100 | 100 |
101 } // namespace internal | 101 } // namespace internal |
102 | 102 |
103 } // namespace ash | 103 } // namespace ash |
OLD | NEW |