| 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 <algorithm> | 7 #include <algorithm> |
| 8 #include <cmath> | 8 #include <cmath> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 1398 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1409 } | 1409 } |
| 1410 | 1410 |
| 1411 bool AcceleratorController::ShouldActionConsumeKeyEvent( | 1411 bool AcceleratorController::ShouldActionConsumeKeyEvent( |
| 1412 AcceleratorAction action) { | 1412 AcceleratorAction action) { |
| 1413 // Adding new exceptions is *STRONGLY* discouraged. | 1413 // Adding new exceptions is *STRONGLY* discouraged. |
| 1414 return true; | 1414 return true; |
| 1415 } | 1415 } |
| 1416 | 1416 |
| 1417 AcceleratorController::AcceleratorProcessingRestriction | 1417 AcceleratorController::AcceleratorProcessingRestriction |
| 1418 AcceleratorController::GetAcceleratorProcessingRestriction(int action) { | 1418 AcceleratorController::GetAcceleratorProcessingRestriction(int action) { |
| 1419 if (WmShell::Get()->IsPinned() && |
| 1420 reserved_actions_.find(action) == reserved_actions_.end()) { |
| 1421 return RESTRICTION_PREVENT_PROCESSING_AND_PROPAGATION; |
| 1422 } |
| 1419 ash::Shell* shell = ash::Shell::GetInstance(); | 1423 ash::Shell* shell = ash::Shell::GetInstance(); |
| 1420 if (!shell->session_state_delegate()->IsActiveUserSessionStarted() && | 1424 if (!shell->session_state_delegate()->IsActiveUserSessionStarted() && |
| 1421 actions_allowed_at_login_screen_.find(action) == | 1425 actions_allowed_at_login_screen_.find(action) == |
| 1422 actions_allowed_at_login_screen_.end()) { | 1426 actions_allowed_at_login_screen_.end()) { |
| 1423 return RESTRICTION_PREVENT_PROCESSING; | 1427 return RESTRICTION_PREVENT_PROCESSING; |
| 1424 } | 1428 } |
| 1425 if (shell->session_state_delegate()->IsScreenLocked() && | 1429 if (shell->session_state_delegate()->IsScreenLocked() && |
| 1426 actions_allowed_at_lock_screen_.find(action) == | 1430 actions_allowed_at_lock_screen_.find(action) == |
| 1427 actions_allowed_at_lock_screen_.end()) { | 1431 actions_allowed_at_lock_screen_.end()) { |
| 1428 return RESTRICTION_PREVENT_PROCESSING; | 1432 return RESTRICTION_PREVENT_PROCESSING; |
| (...skipping 22 matching lines...) Expand all Loading... |
| 1451 } | 1455 } |
| 1452 | 1456 |
| 1453 void AcceleratorController::SetKeyboardBrightnessControlDelegate( | 1457 void AcceleratorController::SetKeyboardBrightnessControlDelegate( |
| 1454 std::unique_ptr<KeyboardBrightnessControlDelegate> | 1458 std::unique_ptr<KeyboardBrightnessControlDelegate> |
| 1455 keyboard_brightness_control_delegate) { | 1459 keyboard_brightness_control_delegate) { |
| 1456 keyboard_brightness_control_delegate_ = | 1460 keyboard_brightness_control_delegate_ = |
| 1457 std::move(keyboard_brightness_control_delegate); | 1461 std::move(keyboard_brightness_control_delegate); |
| 1458 } | 1462 } |
| 1459 | 1463 |
| 1460 } // namespace ash | 1464 } // namespace ash |
| OLD | NEW |