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/accelerators/accelerator_table.h" | 7 #include "ash/accelerators/accelerator_table.h" |
8 #include "ash/ash_switches.h" | 8 #include "ash/ash_switches.h" |
9 #include "ash/caps_lock_delegate.h" | 9 #include "ash/caps_lock_delegate.h" |
10 #include "ash/desktop_background/desktop_background_controller.h" | 10 #include "ash/desktop_background/desktop_background_controller.h" |
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
280 } | 280 } |
281 | 281 |
282 void AcceleratorController::UnregisterAll(ui::AcceleratorTarget* target) { | 282 void AcceleratorController::UnregisterAll(ui::AcceleratorTarget* target) { |
283 accelerator_manager_->UnregisterAll(target); | 283 accelerator_manager_->UnregisterAll(target); |
284 } | 284 } |
285 | 285 |
286 bool AcceleratorController::Process(const ui::Accelerator& accelerator) { | 286 bool AcceleratorController::Process(const ui::Accelerator& accelerator) { |
287 return accelerator_manager_->Process(accelerator); | 287 return accelerator_manager_->Process(accelerator); |
288 } | 288 } |
289 | 289 |
| 290 bool AcceleratorController::IsRegistered( |
| 291 const ui::Accelerator& accelerator) const { |
| 292 return accelerator_manager_->GetCurrentTarget(accelerator) != NULL; |
| 293 } |
| 294 |
290 void AcceleratorController::SetBrightnessControlDelegate( | 295 void AcceleratorController::SetBrightnessControlDelegate( |
291 scoped_ptr<BrightnessControlDelegate> brightness_control_delegate) { | 296 scoped_ptr<BrightnessControlDelegate> brightness_control_delegate) { |
292 brightness_control_delegate_.swap(brightness_control_delegate); | 297 brightness_control_delegate_.swap(brightness_control_delegate); |
293 } | 298 } |
294 | 299 |
295 void AcceleratorController::SetCapsLockDelegate( | 300 void AcceleratorController::SetCapsLockDelegate( |
296 scoped_ptr<CapsLockDelegate> caps_lock_delegate) { | 301 scoped_ptr<CapsLockDelegate> caps_lock_delegate) { |
297 caps_lock_delegate_.swap(caps_lock_delegate); | 302 caps_lock_delegate_.swap(caps_lock_delegate); |
298 } | 303 } |
299 | 304 |
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
552 // Then set this one as active. | 557 // Then set this one as active. |
553 ActivateLauncherItem(found_index); | 558 ActivateLauncherItem(found_index); |
554 } | 559 } |
555 } | 560 } |
556 | 561 |
557 bool AcceleratorController::CanHandleAccelerators() const { | 562 bool AcceleratorController::CanHandleAccelerators() const { |
558 return true; | 563 return true; |
559 } | 564 } |
560 | 565 |
561 } // namespace ash | 566 } // namespace ash |
OLD | NEW |