OLD | NEW |
1 // Copyright (c) 2011 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 "ui/views/accessible_pane_view.h" | 5 #include "ui/views/accessible_pane_view.h" |
6 | 6 |
7 #include "base/message_loop.h" | 7 #include "base/message_loop.h" |
8 #include "ui/base/accessibility/accessible_view_state.h" | 8 #include "ui/base/accessibility/accessible_view_state.h" |
9 #include "ui/views/focus/focus_search.h" | 9 #include "ui/views/focus/focus_search.h" |
10 #include "ui/views/focus/view_storage.h" | 10 #include "ui/views/focus/view_storage.h" |
11 #include "ui/views/widget/widget.h" | 11 #include "ui/views/widget/widget.h" |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 return false; | 53 return false; |
54 | 54 |
55 focus_manager_->SetFocusedView(initial_focus); | 55 focus_manager_->SetFocusedView(initial_focus); |
56 | 56 |
57 // If we already have pane focus, we're done. | 57 // If we already have pane focus, we're done. |
58 if (pane_has_focus_) | 58 if (pane_has_focus_) |
59 return true; | 59 return true; |
60 | 60 |
61 // Otherwise, set accelerators and start listening for focus change events. | 61 // Otherwise, set accelerators and start listening for focus change events. |
62 pane_has_focus_ = true; | 62 pane_has_focus_ = true; |
63 focus_manager_->RegisterAccelerator(home_key_, this); | 63 ui::AcceleratorManager::HandlerPriority normal = |
64 focus_manager_->RegisterAccelerator(end_key_, this); | 64 ui::AcceleratorManager::kNormalPriority; |
65 focus_manager_->RegisterAccelerator(escape_key_, this); | 65 focus_manager_->RegisterAccelerator(home_key_, normal, this); |
66 focus_manager_->RegisterAccelerator(left_key_, this); | 66 focus_manager_->RegisterAccelerator(end_key_, normal, this); |
67 focus_manager_->RegisterAccelerator(right_key_, this); | 67 focus_manager_->RegisterAccelerator(escape_key_, normal, this); |
| 68 focus_manager_->RegisterAccelerator(left_key_, normal, this); |
| 69 focus_manager_->RegisterAccelerator(right_key_, normal, this); |
68 focus_manager_->AddFocusChangeListener(this); | 70 focus_manager_->AddFocusChangeListener(this); |
69 | 71 |
70 return true; | 72 return true; |
71 } | 73 } |
72 | 74 |
73 bool AccessiblePaneView::SetPaneFocusAndFocusDefault() { | 75 bool AccessiblePaneView::SetPaneFocusAndFocusDefault() { |
74 return SetPaneFocus(GetDefaultFocusableChild()); | 76 return SetPaneFocus(GetDefaultFocusableChild()); |
75 } | 77 } |
76 | 78 |
77 views::View* AccessiblePaneView::GetDefaultFocusableChild() { | 79 views::View* AccessiblePaneView::GetDefaultFocusableChild() { |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
196 DCHECK(pane_has_focus_); | 198 DCHECK(pane_has_focus_); |
197 return NULL; | 199 return NULL; |
198 } | 200 } |
199 | 201 |
200 views::View* AccessiblePaneView::GetFocusTraversableParentView() { | 202 views::View* AccessiblePaneView::GetFocusTraversableParentView() { |
201 DCHECK(pane_has_focus_); | 203 DCHECK(pane_has_focus_); |
202 return NULL; | 204 return NULL; |
203 } | 205 } |
204 | 206 |
205 } // namespace views | 207 } // namespace views |
OLD | NEW |