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/brightness_control_delegate.h" | 7 #include "ash/brightness_control_delegate.h" |
8 #include "ash/caps_lock_delegate.h" | 8 #include "ash/caps_lock_delegate.h" |
9 #include "ash/ime_control_delegate.h" | 9 #include "ash/ime_control_delegate.h" |
10 #include "ash/launcher/launcher.h" | 10 #include "ash/launcher/launcher.h" |
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
269 kAcceleratorData[i].alt); | 269 kAcceleratorData[i].alt); |
270 accelerator.set_type(kAcceleratorData[i].type); | 270 accelerator.set_type(kAcceleratorData[i].type); |
271 Register(accelerator, this); | 271 Register(accelerator, this); |
272 CHECK(accelerators_.insert( | 272 CHECK(accelerators_.insert( |
273 std::make_pair(accelerator, kAcceleratorData[i].action)).second); | 273 std::make_pair(accelerator, kAcceleratorData[i].action)).second); |
274 } | 274 } |
275 } | 275 } |
276 | 276 |
277 void AcceleratorController::Register(const ui::Accelerator& accelerator, | 277 void AcceleratorController::Register(const ui::Accelerator& accelerator, |
278 ui::AcceleratorTarget* target) { | 278 ui::AcceleratorTarget* target) { |
279 accelerator_manager_->Register(accelerator, target); | 279 accelerator_manager_->Register(accelerator, false, target); |
280 } | 280 } |
281 | 281 |
282 void AcceleratorController::Unregister(const ui::Accelerator& accelerator, | 282 void AcceleratorController::Unregister(const ui::Accelerator& accelerator, |
283 ui::AcceleratorTarget* target) { | 283 ui::AcceleratorTarget* target) { |
284 accelerator_manager_->Unregister(accelerator, target); | 284 accelerator_manager_->Unregister(accelerator, target); |
285 } | 285 } |
286 | 286 |
287 void AcceleratorController::UnregisterAll(ui::AcceleratorTarget* target) { | 287 void AcceleratorController::UnregisterAll(ui::AcceleratorTarget* target) { |
288 accelerator_manager_->UnregisterAll(target); | 288 accelerator_manager_->UnregisterAll(target); |
289 } | 289 } |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
396 case TOGGLE_DESKTOP_BACKGROUND_MODE: | 396 case TOGGLE_DESKTOP_BACKGROUND_MODE: |
397 return HandleToggleDesktopBackgroundMode(); | 397 return HandleToggleDesktopBackgroundMode(); |
398 case TOGGLE_ROOT_WINDOW_FULL_SCREEN: | 398 case TOGGLE_ROOT_WINDOW_FULL_SCREEN: |
399 return HandleToggleRootWindowFullScreen(); | 399 return HandleToggleRootWindowFullScreen(); |
400 case PRINT_LAYER_HIERARCHY: | 400 case PRINT_LAYER_HIERARCHY: |
401 return HandlePrintLayerHierarchy(); | 401 return HandlePrintLayerHierarchy(); |
402 case PRINT_WINDOW_HIERARCHY: | 402 case PRINT_WINDOW_HIERARCHY: |
403 return HandlePrintWindowHierarchy(); | 403 return HandlePrintWindowHierarchy(); |
404 #endif | 404 #endif |
405 default: | 405 default: |
406 NOTREACHED() << "Unhandled action " << it->second;; | 406 NOTREACHED() << "Unhandled action " << it->second; |
407 } | 407 } |
408 return false; | 408 return false; |
409 } | 409 } |
410 | 410 |
411 bool AcceleratorController::CanHandleAccelerators() const { | 411 bool AcceleratorController::CanHandleAccelerators() const { |
412 return true; | 412 return true; |
413 } | 413 } |
414 | 414 |
415 } // namespace ash | 415 } // namespace ash |
OLD | NEW |