Chromium Code Reviews| 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 1384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1395 } | 1395 } |
| 1396 | 1396 |
| 1397 bool AcceleratorController::ShouldActionConsumeKeyEvent( | 1397 bool AcceleratorController::ShouldActionConsumeKeyEvent( |
| 1398 AcceleratorAction action) { | 1398 AcceleratorAction action) { |
| 1399 // Adding new exceptions is *STRONGLY* discouraged. | 1399 // Adding new exceptions is *STRONGLY* discouraged. |
| 1400 return true; | 1400 return true; |
| 1401 } | 1401 } |
| 1402 | 1402 |
| 1403 AcceleratorController::AcceleratorProcessingRestriction | 1403 AcceleratorController::AcceleratorProcessingRestriction |
| 1404 AcceleratorController::GetAcceleratorProcessingRestriction(int action) { | 1404 AcceleratorController::GetAcceleratorProcessingRestriction(int action) { |
| 1405 if (WmShell::Get()->IsPinned() && | |
| 1406 reserved_actions_.find(action) == reserved_actions_.end()) { | |
| 1407 return RESTRICTION_PREVENT_PROCESSING_AND_PROPAGATION; | |
| 1408 } | |
|
oshima
2016/06/17 10:26:53
won't this also prevent power/audio accelerators?
hidehiko
2016/06/17 17:19:21
Good point. I added the table, based on the refere
| |
| 1405 ash::Shell* shell = ash::Shell::GetInstance(); | 1409 ash::Shell* shell = ash::Shell::GetInstance(); |
| 1406 if (!shell->session_state_delegate()->IsActiveUserSessionStarted() && | 1410 if (!shell->session_state_delegate()->IsActiveUserSessionStarted() && |
| 1407 actions_allowed_at_login_screen_.find(action) == | 1411 actions_allowed_at_login_screen_.find(action) == |
| 1408 actions_allowed_at_login_screen_.end()) { | 1412 actions_allowed_at_login_screen_.end()) { |
| 1409 return RESTRICTION_PREVENT_PROCESSING; | 1413 return RESTRICTION_PREVENT_PROCESSING; |
| 1410 } | 1414 } |
| 1411 if (shell->session_state_delegate()->IsScreenLocked() && | 1415 if (shell->session_state_delegate()->IsScreenLocked() && |
| 1412 actions_allowed_at_lock_screen_.find(action) == | 1416 actions_allowed_at_lock_screen_.find(action) == |
| 1413 actions_allowed_at_lock_screen_.end()) { | 1417 actions_allowed_at_lock_screen_.end()) { |
| 1414 return RESTRICTION_PREVENT_PROCESSING; | 1418 return RESTRICTION_PREVENT_PROCESSING; |
| (...skipping 22 matching lines...) Expand all Loading... | |
| 1437 } | 1441 } |
| 1438 | 1442 |
| 1439 void AcceleratorController::SetKeyboardBrightnessControlDelegate( | 1443 void AcceleratorController::SetKeyboardBrightnessControlDelegate( |
| 1440 std::unique_ptr<KeyboardBrightnessControlDelegate> | 1444 std::unique_ptr<KeyboardBrightnessControlDelegate> |
| 1441 keyboard_brightness_control_delegate) { | 1445 keyboard_brightness_control_delegate) { |
| 1442 keyboard_brightness_control_delegate_ = | 1446 keyboard_brightness_control_delegate_ = |
| 1443 std::move(keyboard_brightness_control_delegate); | 1447 std::move(keyboard_brightness_control_delegate); |
| 1444 } | 1448 } |
| 1445 | 1449 |
| 1446 } // namespace ash | 1450 } // namespace ash |
| OLD | NEW |