| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "athena/input/accelerator_manager_impl.h" | 5 #include "athena/input/accelerator_manager_impl.h" |
| 6 | 6 |
| 7 #include "athena/input/public/input_manager.h" | 7 #include "athena/input/public/input_manager.h" |
| 8 #include "athena/util/switches.h" | 8 #include "athena/util/switches.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "ui/aura/window.h" | 10 #include "ui/aura/window.h" |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 // accelerators as well as local accelerators. | 26 // accelerators as well as local accelerators. |
| 27 class AcceleratorManagerImpl::AcceleratorWrapper { | 27 class AcceleratorManagerImpl::AcceleratorWrapper { |
| 28 public: | 28 public: |
| 29 virtual ~AcceleratorWrapper() {} | 29 virtual ~AcceleratorWrapper() {} |
| 30 virtual void Register(const ui::Accelerator& accelerator, | 30 virtual void Register(const ui::Accelerator& accelerator, |
| 31 ui::AcceleratorTarget* target) = 0; | 31 ui::AcceleratorTarget* target) = 0; |
| 32 virtual void Unregister(const ui::Accelerator& accelerator, | 32 virtual void Unregister(const ui::Accelerator& accelerator, |
| 33 ui::AcceleratorTarget* target) = 0; | 33 ui::AcceleratorTarget* target) = 0; |
| 34 virtual bool Process(const ui::Accelerator& accelerator) = 0; | 34 virtual bool Process(const ui::Accelerator& accelerator) = 0; |
| 35 virtual ui::AcceleratorTarget* GetCurrentTarget( | 35 virtual ui::AcceleratorTarget* GetCurrentTarget( |
| 36 const ui::Accelerator& accelertor) const = 0; | 36 const ui::Accelerator& accelerator) const = 0; |
| 37 }; | 37 }; |
| 38 | 38 |
| 39 namespace { | 39 namespace { |
| 40 | 40 |
| 41 // Accelerators inside nested message loop are handled by | 41 // Accelerators inside nested message loop are handled by |
| 42 // wm::NestedAcceleratorController while accelerators in normal case are | 42 // wm::NestedAcceleratorController while accelerators in normal case are |
| 43 // handled by wm::AcceleratorFilter. These delegates act bridges in these | 43 // handled by wm::AcceleratorFilter. These delegates act bridges in these |
| 44 // two different environment so that AcceleratorManagerImpl can handle | 44 // two different environment so that AcceleratorManagerImpl can handle |
| 45 // accelerators in an uniform way. | 45 // accelerators in an uniform way. |
| 46 | 46 |
| (...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 357 return InputManager::Get()->GetAcceleratorManager(); | 357 return InputManager::Get()->GetAcceleratorManager(); |
| 358 } | 358 } |
| 359 | 359 |
| 360 // static | 360 // static |
| 361 scoped_ptr<AcceleratorManager> AcceleratorManager::CreateForFocusManager( | 361 scoped_ptr<AcceleratorManager> AcceleratorManager::CreateForFocusManager( |
| 362 views::FocusManager* focus_manager) { | 362 views::FocusManager* focus_manager) { |
| 363 return AcceleratorManagerImpl::CreateForFocusManager(focus_manager).Pass(); | 363 return AcceleratorManagerImpl::CreateForFocusManager(focus_manager).Pass(); |
| 364 } | 364 } |
| 365 | 365 |
| 366 } // namespace athena | 366 } // namespace athena |
| OLD | NEW |