| 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 #include "ash/accelerators/accelerator_table.h" | 6 #include "ash/accelerators/accelerator_table.h" |
| 7 #include "ash/caps_lock_delegate.h" | 7 #include "ash/caps_lock_delegate.h" |
| 8 #include "ash/display/display_manager.h" | 8 #include "ash/display/display_manager.h" |
| 9 #include "ash/ime_control_delegate.h" | 9 #include "ash/ime_control_delegate.h" |
| 10 #include "ash/screenshot_delegate.h" | 10 #include "ash/screenshot_delegate.h" |
| (...skipping 692 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 703 EXPECT_FALSE(ProcessWithContext( | 703 EXPECT_FALSE(ProcessWithContext( |
| 704 ui::Accelerator(ui::VKEY_SHIFT, ui::EF_NONE))); | 704 ui::Accelerator(ui::VKEY_SHIFT, ui::EF_NONE))); |
| 705 EXPECT_FALSE(ProcessWithContext( | 705 EXPECT_FALSE(ProcessWithContext( |
| 706 ReleaseAccelerator(ui::VKEY_SHIFT, ui::EF_NONE))); | 706 ReleaseAccelerator(ui::VKEY_SHIFT, ui::EF_NONE))); |
| 707 } | 707 } |
| 708 // ToggleCapsLock | 708 // ToggleCapsLock |
| 709 { | 709 { |
| 710 CapsLockDelegate* delegate = Shell::GetInstance()->caps_lock_delegate(); | 710 CapsLockDelegate* delegate = Shell::GetInstance()->caps_lock_delegate(); |
| 711 delegate->SetCapsLockEnabled(true); | 711 delegate->SetCapsLockEnabled(true); |
| 712 EXPECT_TRUE(delegate->IsCapsLockEnabled()); | 712 EXPECT_TRUE(delegate->IsCapsLockEnabled()); |
| 713 EXPECT_FALSE(ProcessWithContext( |
| 714 ui::Accelerator(ui::VKEY_LWIN, ui::EF_ALT_DOWN))); |
| 713 EXPECT_TRUE(ProcessWithContext( | 715 EXPECT_TRUE(ProcessWithContext( |
| 716 ReleaseAccelerator(ui::VKEY_LWIN, ui::EF_ALT_DOWN))); |
| 717 EXPECT_FALSE(delegate->IsCapsLockEnabled()); |
| 718 EXPECT_FALSE(ProcessWithContext( |
| 714 ui::Accelerator(ui::VKEY_LWIN, ui::EF_ALT_DOWN))); | 719 ui::Accelerator(ui::VKEY_LWIN, ui::EF_ALT_DOWN))); |
| 715 EXPECT_FALSE(delegate->IsCapsLockEnabled()); | |
| 716 EXPECT_TRUE(ProcessWithContext( | 720 EXPECT_TRUE(ProcessWithContext( |
| 717 ui::Accelerator(ui::VKEY_LWIN, ui::EF_ALT_DOWN))); | 721 ReleaseAccelerator(ui::VKEY_LWIN, ui::EF_ALT_DOWN))); |
| 718 EXPECT_TRUE(delegate->IsCapsLockEnabled()); | 722 EXPECT_TRUE(delegate->IsCapsLockEnabled()); |
| 719 } | 723 } |
| 720 const ui::Accelerator volume_mute(ui::VKEY_VOLUME_MUTE, ui::EF_NONE); | 724 const ui::Accelerator volume_mute(ui::VKEY_VOLUME_MUTE, ui::EF_NONE); |
| 721 const ui::Accelerator volume_down(ui::VKEY_VOLUME_DOWN, ui::EF_NONE); | 725 const ui::Accelerator volume_down(ui::VKEY_VOLUME_DOWN, ui::EF_NONE); |
| 722 const ui::Accelerator volume_up(ui::VKEY_VOLUME_UP, ui::EF_NONE); | 726 const ui::Accelerator volume_up(ui::VKEY_VOLUME_UP, ui::EF_NONE); |
| 723 { | 727 { |
| 724 DummyVolumeControlDelegate* delegate = | 728 DummyVolumeControlDelegate* delegate = |
| 725 new DummyVolumeControlDelegate(false); | 729 new DummyVolumeControlDelegate(false); |
| 726 ash::Shell::GetInstance()->system_tray_delegate()->SetVolumeControlDelegate( | 730 ash::Shell::GetInstance()->system_tray_delegate()->SetVolumeControlDelegate( |
| 727 scoped_ptr<VolumeControlDelegate>(delegate).Pass()); | 731 scoped_ptr<VolumeControlDelegate>(delegate).Pass()); |
| (...skipping 548 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1276 EXPECT_EQ(volume_down, delegate->last_accelerator()); | 1280 EXPECT_EQ(volume_down, delegate->last_accelerator()); |
| 1277 EXPECT_EQ(0, delegate->handle_volume_up_count()); | 1281 EXPECT_EQ(0, delegate->handle_volume_up_count()); |
| 1278 EXPECT_TRUE(ProcessWithContext(volume_up)); | 1282 EXPECT_TRUE(ProcessWithContext(volume_up)); |
| 1279 EXPECT_EQ(1, delegate->handle_volume_up_count()); | 1283 EXPECT_EQ(1, delegate->handle_volume_up_count()); |
| 1280 EXPECT_EQ(volume_up, delegate->last_accelerator()); | 1284 EXPECT_EQ(volume_up, delegate->last_accelerator()); |
| 1281 } | 1285 } |
| 1282 } | 1286 } |
| 1283 #endif | 1287 #endif |
| 1284 | 1288 |
| 1285 } // namespace ash | 1289 } // namespace ash |
| OLD | NEW |