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

Side by Side Diff: ui/views/focus/focus_manager.cc

Issue 2586333003: Make mash register initial batch of accelerators in single shot. (Closed)
Patch Set: Fix comments. Move inline function to .h Created 3 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
« no previous file with comments | « ui/base/accelerators/accelerator_manager_unittest.cc ('k') | no next file » | 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) 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 "ui/views/focus/focus_manager.h" 5 #include "ui/views/focus/focus_manager.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/auto_reset.h" 10 #include "base/auto_reset.h"
(...skipping 479 matching lines...) Expand 10 before | Expand all | Expand 10 after
490 &new_focus_traversable, 490 &new_focus_traversable,
491 &new_starting_view); 491 &new_starting_view);
492 } 492 }
493 return v; 493 return v;
494 } 494 }
495 495
496 void FocusManager::RegisterAccelerator( 496 void FocusManager::RegisterAccelerator(
497 const ui::Accelerator& accelerator, 497 const ui::Accelerator& accelerator,
498 ui::AcceleratorManager::HandlerPriority priority, 498 ui::AcceleratorManager::HandlerPriority priority,
499 ui::AcceleratorTarget* target) { 499 ui::AcceleratorTarget* target) {
500 accelerator_manager_->Register(accelerator, priority, target); 500 accelerator_manager_->Register({accelerator}, priority, target);
501 } 501 }
502 502
503 void FocusManager::UnregisterAccelerator(const ui::Accelerator& accelerator, 503 void FocusManager::UnregisterAccelerator(const ui::Accelerator& accelerator,
504 ui::AcceleratorTarget* target) { 504 ui::AcceleratorTarget* target) {
505 accelerator_manager_->Unregister(accelerator, target); 505 accelerator_manager_->Unregister(accelerator, target);
506 } 506 }
507 507
508 void FocusManager::UnregisterAccelerators(ui::AcceleratorTarget* target) { 508 void FocusManager::UnregisterAccelerators(ui::AcceleratorTarget* target) {
509 accelerator_manager_->UnregisterAll(target); 509 accelerator_manager_->UnregisterAll(target);
510 } 510 }
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
568 // |keyboard_accessible_| is only used on Mac. 568 // |keyboard_accessible_| is only used on Mac.
569 #if defined(OS_MACOSX) 569 #if defined(OS_MACOSX)
570 return keyboard_accessible_ ? view->IsAccessibilityFocusable() 570 return keyboard_accessible_ ? view->IsAccessibilityFocusable()
571 : view->IsFocusable(); 571 : view->IsFocusable();
572 #else 572 #else
573 return view->IsAccessibilityFocusable(); 573 return view->IsAccessibilityFocusable();
574 #endif 574 #endif
575 } 575 }
576 576
577 } // namespace views 577 } // namespace views
OLDNEW
« no previous file with comments | « ui/base/accelerators/accelerator_manager_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698