| OLD | NEW |
| 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 "ash/caps_lock_delegate.h" | 7 #include "ash/caps_lock_delegate.h" |
| 8 #include "ash/launcher/launcher.h" | 8 #include "ash/launcher/launcher.h" |
| 9 #include "ash/launcher/launcher_model.h" | 9 #include "ash/launcher/launcher_model.h" |
| 10 #include "ash/screenshot_delegate.h" | 10 #include "ash/screenshot_delegate.h" |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 | 152 |
| 153 } // namespace | 153 } // namespace |
| 154 | 154 |
| 155 namespace ash { | 155 namespace ash { |
| 156 | 156 |
| 157 //////////////////////////////////////////////////////////////////////////////// | 157 //////////////////////////////////////////////////////////////////////////////// |
| 158 // AcceleratorController, public: | 158 // AcceleratorController, public: |
| 159 | 159 |
| 160 AcceleratorController::AcceleratorController() | 160 AcceleratorController::AcceleratorController() |
| 161 : accelerator_manager_(new ui::AcceleratorManager) { | 161 : accelerator_manager_(new ui::AcceleratorManager) { |
| 162 aura::client::SetAcceleratorClient(this); |
| 162 Init(); | 163 Init(); |
| 163 } | 164 } |
| 164 | 165 |
| 165 AcceleratorController::~AcceleratorController() { | 166 AcceleratorController::~AcceleratorController() { |
| 166 } | 167 } |
| 167 | 168 |
| 168 void AcceleratorController::Init() { | 169 void AcceleratorController::Init() { |
| 169 for (size_t i = 0; i < arraysize(kAcceleratorData); ++i) { | 170 for (size_t i = 0; i < arraysize(kAcceleratorData); ++i) { |
| 170 ui::Accelerator accelerator(kAcceleratorData[i].keycode, | 171 ui::Accelerator accelerator(kAcceleratorData[i].keycode, |
| 171 kAcceleratorData[i].shift, | 172 kAcceleratorData[i].shift, |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 252 NOTREACHED() << "Unhandled action " << it->second;; | 253 NOTREACHED() << "Unhandled action " << it->second;; |
| 253 } | 254 } |
| 254 return false; | 255 return false; |
| 255 } | 256 } |
| 256 | 257 |
| 257 bool AcceleratorController::CanHandleAccelerators() const { | 258 bool AcceleratorController::CanHandleAccelerators() const { |
| 258 return true; | 259 return true; |
| 259 } | 260 } |
| 260 | 261 |
| 261 } // namespace ash | 262 } // namespace ash |
| OLD | NEW |