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

Side by Side Diff: ash/accelerators/accelerator_controller.cc

Issue 838253004: MacViews: Fix duplicate definition of ExtensionKeyBindingRegistry::SetShortcutHandlingSuspended (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@DragBookmarks2
Patch Set: Created 5 years, 11 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 "ash/accelerators/accelerator_controller.h" 5 #include "ash/accelerators/accelerator_controller.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <cmath> 8 #include <cmath>
9 #include <string> 9 #include <string>
10 10
(...skipping 700 matching lines...) Expand 10 before | Expand all | Expand 10 after
711 ui::AcceleratorTarget* target) { 711 ui::AcceleratorTarget* target) {
712 accelerator_manager_->Unregister(accelerator, target); 712 accelerator_manager_->Unregister(accelerator, target);
713 } 713 }
714 714
715 void AcceleratorController::UnregisterAll(ui::AcceleratorTarget* target) { 715 void AcceleratorController::UnregisterAll(ui::AcceleratorTarget* target) {
716 accelerator_manager_->UnregisterAll(target); 716 accelerator_manager_->UnregisterAll(target);
717 } 717 }
718 718
719 bool AcceleratorController::Process(const ui::Accelerator& accelerator) { 719 bool AcceleratorController::Process(const ui::Accelerator& accelerator) {
720 if (ime_control_delegate_) { 720 if (ime_control_delegate_) {
721 return accelerator_manager_->Process( 721 return accelerator_manager_->ProcessAccelerator(
722 ime_control_delegate_->RemapAccelerator(accelerator)); 722 ime_control_delegate_->RemapAccelerator(accelerator));
723 } 723 }
724 return accelerator_manager_->Process(accelerator); 724 return accelerator_manager_->ProcessAccelerator(accelerator);
725 } 725 }
726 726
727 bool AcceleratorController::IsRegistered( 727 bool AcceleratorController::IsRegistered(
728 const ui::Accelerator& accelerator) const { 728 const ui::Accelerator& accelerator) const {
729 return accelerator_manager_->GetCurrentTarget(accelerator) != NULL; 729 return accelerator_manager_->GetTargetForAccelerator(accelerator) != NULL;
730 } 730 }
731 731
732 bool AcceleratorController::IsPreferred( 732 bool AcceleratorController::IsPreferred(
733 const ui::Accelerator& accelerator) const { 733 const ui::Accelerator& accelerator) const {
734 const ui::Accelerator remapped_accelerator = ime_control_delegate_.get() ? 734 const ui::Accelerator remapped_accelerator = ime_control_delegate_.get() ?
735 ime_control_delegate_->RemapAccelerator(accelerator) : accelerator; 735 ime_control_delegate_->RemapAccelerator(accelerator) : accelerator;
736 736
737 std::map<ui::Accelerator, AcceleratorAction>::const_iterator iter = 737 std::map<ui::Accelerator, AcceleratorAction>::const_iterator iter =
738 accelerators_.find(remapped_accelerator); 738 accelerators_.find(remapped_accelerator);
739 if (iter == accelerators_.end()) 739 if (iter == accelerators_.end())
(...skipping 581 matching lines...) Expand 10 before | Expand all | Expand 10 after
1321 } 1321 }
1322 1322
1323 void AcceleratorController::SetKeyboardBrightnessControlDelegate( 1323 void AcceleratorController::SetKeyboardBrightnessControlDelegate(
1324 scoped_ptr<KeyboardBrightnessControlDelegate> 1324 scoped_ptr<KeyboardBrightnessControlDelegate>
1325 keyboard_brightness_control_delegate) { 1325 keyboard_brightness_control_delegate) {
1326 keyboard_brightness_control_delegate_ = 1326 keyboard_brightness_control_delegate_ =
1327 keyboard_brightness_control_delegate.Pass(); 1327 keyboard_brightness_control_delegate.Pass();
1328 } 1328 }
1329 1329
1330 } // namespace ash 1330 } // namespace ash
OLDNEW
« no previous file with comments | « no previous file | ash/accelerators/focus_manager_factory.h » ('j') | ash/accelerators/focus_manager_factory.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698