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

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

Issue 1177773002: Deprecating high-conflict accelerators (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Simplified the design, modified tests accordingly, made accelerators consumable by webcontents if n… Created 5 years, 6 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
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 471 matching lines...) Expand 10 before | Expand all | Expand 10 after
482 } 482 }
483 483
484 bool FocusManager::ProcessAccelerator(const ui::Accelerator& accelerator) { 484 bool FocusManager::ProcessAccelerator(const ui::Accelerator& accelerator) {
485 if (accelerator_manager_->Process(accelerator)) 485 if (accelerator_manager_->Process(accelerator))
486 return true; 486 return true;
487 if (delegate_.get()) 487 if (delegate_.get())
488 return delegate_->ProcessAccelerator(accelerator); 488 return delegate_->ProcessAccelerator(accelerator);
489 return false; 489 return false;
490 } 490 }
491 491
492 bool FocusManager::IsAcceleratorDeprecated(
493 const ui::Accelerator& accelerator) const {
494 return delegate_.get() &&
495 delegate_.get()->IsAcceleratorDeprecated(accelerator);
496 }
497
492 ui::AcceleratorTarget* FocusManager::GetCurrentTargetForAccelerator( 498 ui::AcceleratorTarget* FocusManager::GetCurrentTargetForAccelerator(
493 const ui::Accelerator& accelerator) const { 499 const ui::Accelerator& accelerator) const {
494 ui::AcceleratorTarget* target = 500 ui::AcceleratorTarget* target =
495 accelerator_manager_->GetCurrentTarget(accelerator); 501 accelerator_manager_->GetCurrentTarget(accelerator);
496 if (!target && delegate_.get()) 502 if (!target && delegate_.get())
497 target = delegate_->GetCurrentTargetForAccelerator(accelerator); 503 target = delegate_->GetCurrentTargetForAccelerator(accelerator);
498 return target; 504 return target;
499 } 505 }
500 506
501 bool FocusManager::HasPriorityHandler( 507 bool FocusManager::HasPriorityHandler(
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
536 } 542 }
537 if (key_code == ui::VKEY_RIGHT || key_code == ui::VKEY_DOWN) { 543 if (key_code == ui::VKEY_RIGHT || key_code == ui::VKEY_DOWN) {
538 AdvanceFocus(false); 544 AdvanceFocus(false);
539 return true; 545 return true;
540 } 546 }
541 547
542 return false; 548 return false;
543 } 549 }
544 550
545 } // namespace views 551 } // namespace views
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698