Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(589)

Side by Side Diff: ui/views/accessible_pane_view.cc

Issue 9402018: Experimental Extension Keybinding (first cut). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ui/base/accelerators/accelerator_manager.cc ('k') | ui/views/focus/focus_manager.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « ui/base/accelerators/accelerator_manager.cc ('k') | ui/views/focus/focus_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698