| 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/common/accelerators/accelerator_controller.h" | 5 #include "ash/common/accelerators/accelerator_controller.h" |
| 6 | 6 |
| 7 #include "ash/common/accelerators/accelerator_table.h" | 7 #include "ash/common/accelerators/accelerator_table.h" |
| 8 #include "ash/common/accessibility_delegate.h" | 8 #include "ash/common/accessibility_delegate.h" |
| 9 #include "ash/common/accessibility_types.h" | 9 #include "ash/common/accessibility_types.h" |
| 10 #include "ash/common/ash_switches.h" | 10 #include "ash/common/ash_switches.h" |
| 11 #include "ash/common/ime_control_delegate.h" | 11 #include "ash/common/ime_control_delegate.h" |
| 12 #include "ash/common/session/session_state_delegate.h" | 12 #include "ash/common/session/session_controller.h" |
| 13 #include "ash/common/system/brightness_control_delegate.h" | 13 #include "ash/common/system/brightness_control_delegate.h" |
| 14 #include "ash/common/system/keyboard_brightness_control_delegate.h" | 14 #include "ash/common/system/keyboard_brightness_control_delegate.h" |
| 15 #include "ash/common/system/tray/system_tray_delegate.h" | 15 #include "ash/common/system/tray/system_tray_delegate.h" |
| 16 #include "ash/common/test/test_shelf_delegate.h" | 16 #include "ash/common/test/test_shelf_delegate.h" |
| 17 #include "ash/common/wm/panels/panel_layout_manager.h" | 17 #include "ash/common/wm/panels/panel_layout_manager.h" |
| 18 #include "ash/common/wm/window_positioning_utils.h" | 18 #include "ash/common/wm/window_positioning_utils.h" |
| 19 #include "ash/common/wm/window_state.h" | 19 #include "ash/common/wm/window_state.h" |
| 20 #include "ash/common/wm/wm_event.h" | 20 #include "ash/common/wm/wm_event.h" |
| 21 #include "ash/common/wm_shell.h" | 21 #include "ash/common/wm_shell.h" |
| 22 #include "ash/common/wm_window.h" | 22 #include "ash/common/wm_window.h" |
| (...skipping 1460 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1483 | 1483 |
| 1484 ui::Accelerator CreateAccelerator(const AcceleratorData& data) const { | 1484 ui::Accelerator CreateAccelerator(const AcceleratorData& data) const { |
| 1485 ui::Accelerator result(data.keycode, data.modifiers); | 1485 ui::Accelerator result(data.keycode, data.modifiers); |
| 1486 result.set_key_state(data.trigger_on_press | 1486 result.set_key_state(data.trigger_on_press |
| 1487 ? ui::Accelerator::KeyState::PRESSED | 1487 ? ui::Accelerator::KeyState::PRESSED |
| 1488 : ui::Accelerator::KeyState::RELEASED); | 1488 : ui::Accelerator::KeyState::RELEASED); |
| 1489 return result; | 1489 return result; |
| 1490 } | 1490 } |
| 1491 | 1491 |
| 1492 void ResetStateIfNeeded() { | 1492 void ResetStateIfNeeded() { |
| 1493 if (WmShell::Get()->GetSessionStateDelegate()->IsScreenLocked() || | 1493 if (WmShell::Get()->session_controller()->IsScreenLocked() || |
| 1494 WmShell::Get()->GetSessionStateDelegate()->IsUserSessionBlocked()) { | 1494 WmShell::Get()->session_controller()->IsUserSessionBlocked()) { |
| 1495 UnblockUserSession(); | 1495 UnblockUserSession(); |
| 1496 } | 1496 } |
| 1497 } | 1497 } |
| 1498 | 1498 |
| 1499 bool ContainsDeprecatedAcceleratorNotification(const char* const id) const { | 1499 bool ContainsDeprecatedAcceleratorNotification(const char* const id) const { |
| 1500 return nullptr != message_center()->FindVisibleNotificationById(id); | 1500 return nullptr != message_center()->FindVisibleNotificationById(id); |
| 1501 } | 1501 } |
| 1502 | 1502 |
| 1503 bool IsMessageCenterEmpty() const { | 1503 bool IsMessageCenterEmpty() const { |
| 1504 return message_center()->GetVisibleNotifications().empty(); | 1504 return message_center()->GetVisibleNotifications().empty(); |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1565 // Expect no notifications from the new accelerators. | 1565 // Expect no notifications from the new accelerators. |
| 1566 EXPECT_TRUE(IsMessageCenterEmpty()); | 1566 EXPECT_TRUE(IsMessageCenterEmpty()); |
| 1567 | 1567 |
| 1568 // If the action is LOCK_SCREEN, we must reset the state by unlocking the | 1568 // If the action is LOCK_SCREEN, we must reset the state by unlocking the |
| 1569 // screen before we proceed testing the rest of accelerators. | 1569 // screen before we proceed testing the rest of accelerators. |
| 1570 ResetStateIfNeeded(); | 1570 ResetStateIfNeeded(); |
| 1571 } | 1571 } |
| 1572 } | 1572 } |
| 1573 | 1573 |
| 1574 } // namespace ash | 1574 } // namespace ash |
| OLD | NEW |