| 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/aura/wm_window_aura.h" | 8 #include "ash/aura/wm_window_aura.h" |
| 9 #include "ash/common/accessibility_delegate.h" | 9 #include "ash/common/accessibility_delegate.h" |
| 10 #include "ash/common/accessibility_types.h" | 10 #include "ash/common/accessibility_types.h" |
| (...skipping 1314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1325 } | 1325 } |
| 1326 | 1326 |
| 1327 ui::Accelerator CreateAccelerator(const AcceleratorData& data) const { | 1327 ui::Accelerator CreateAccelerator(const AcceleratorData& data) const { |
| 1328 ui::Accelerator result(data.keycode, data.modifiers); | 1328 ui::Accelerator result(data.keycode, data.modifiers); |
| 1329 result.set_type(data.trigger_on_press ? ui::ET_KEY_PRESSED | 1329 result.set_type(data.trigger_on_press ? ui::ET_KEY_PRESSED |
| 1330 : ui::ET_KEY_RELEASED); | 1330 : ui::ET_KEY_RELEASED); |
| 1331 return result; | 1331 return result; |
| 1332 } | 1332 } |
| 1333 | 1333 |
| 1334 void ResetStateIfNeeded() { | 1334 void ResetStateIfNeeded() { |
| 1335 Shell* shell = Shell::GetInstance(); | 1335 if (WmShell::Get()->GetSessionStateDelegate()->IsScreenLocked() || |
| 1336 if (shell->session_state_delegate()->IsScreenLocked() || | 1336 WmShell::Get()->GetSessionStateDelegate()->IsUserSessionBlocked()) { |
| 1337 shell->session_state_delegate()->IsUserSessionBlocked()) { | |
| 1338 UnblockUserSession(); | 1337 UnblockUserSession(); |
| 1339 } | 1338 } |
| 1340 } | 1339 } |
| 1341 | 1340 |
| 1342 bool ContainsDeprecatedAcceleratorNotification(const char* const id) const { | 1341 bool ContainsDeprecatedAcceleratorNotification(const char* const id) const { |
| 1343 return nullptr != message_center()->FindVisibleNotificationById(id); | 1342 return nullptr != message_center()->FindVisibleNotificationById(id); |
| 1344 } | 1343 } |
| 1345 | 1344 |
| 1346 bool IsMessageCenterEmpty() const { | 1345 bool IsMessageCenterEmpty() const { |
| 1347 return message_center()->GetVisibleNotifications().empty(); | 1346 return message_center()->GetVisibleNotifications().empty(); |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1405 EXPECT_TRUE(IsMessageCenterEmpty()); | 1404 EXPECT_TRUE(IsMessageCenterEmpty()); |
| 1406 | 1405 |
| 1407 // If the action is LOCK_SCREEN, we must reset the state by unlocking the | 1406 // If the action is LOCK_SCREEN, we must reset the state by unlocking the |
| 1408 // screen before we proceed testing the rest of accelerators. | 1407 // screen before we proceed testing the rest of accelerators. |
| 1409 ResetStateIfNeeded(); | 1408 ResetStateIfNeeded(); |
| 1410 } | 1409 } |
| 1411 } | 1410 } |
| 1412 #endif // defined(OS_CHROMEOS) | 1411 #endif // defined(OS_CHROMEOS) |
| 1413 | 1412 |
| 1414 } // namespace ash | 1413 } // namespace ash |
| OLD | NEW |