Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2044)

Unified Diff: ash/accelerators/accelerator_controller.cc

Issue 2072853002: Implement "pinned" mode in ash. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address comments Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/accelerators/accelerator_controller.h ('k') | ash/accelerators/accelerator_controller_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/accelerators/accelerator_controller.cc
diff --git a/ash/accelerators/accelerator_controller.cc b/ash/accelerators/accelerator_controller.cc
index 2aa4ceb3622b4d5fecdbd69a189d7e7aae38395e..5b5c70d5f54e1e5db1ba20bdfc90fedfdb4d0968 100644
--- a/ash/accelerators/accelerator_controller.cc
+++ b/ash/accelerators/accelerator_controller.cc
@@ -915,8 +915,14 @@ void AcceleratorController::Init() {
reserved_actions_.insert(kReservedActions[i]);
for (size_t i = 0; i < kNonrepeatableActionsLength; ++i)
nonrepeatable_actions_.insert(kNonrepeatableActions[i]);
- for (size_t i = 0; i < kActionsAllowedInAppModeLength; ++i)
- actions_allowed_in_app_mode_.insert(kActionsAllowedInAppMode[i]);
+ for (size_t i = 0; i < kActionsAllowedInAppModeOrPinnedModeLength; ++i) {
+ actions_allowed_in_app_mode_.insert(
+ kActionsAllowedInAppModeOrPinnedMode[i]);
+ actions_allowed_in_pinned_mode_.insert(
+ kActionsAllowedInAppModeOrPinnedMode[i]);
+ }
+ for (size_t i = 0; i < kActionsAllowedInPinnedModeLength; ++i)
+ actions_allowed_in_pinned_mode_.insert(kActionsAllowedInPinnedMode[i]);
for (size_t i = 0; i < kActionsNeedingWindowLength; ++i)
actions_needing_window_.insert(kActionsNeedingWindow[i]);
for (size_t i = 0; i < kActionsKeepingMenuOpenLength; ++i)
@@ -1399,6 +1405,11 @@ bool AcceleratorController::ShouldActionConsumeKeyEvent(
AcceleratorController::AcceleratorProcessingRestriction
AcceleratorController::GetAcceleratorProcessingRestriction(int action) {
+ if (WmShell::Get()->IsPinned() &&
+ actions_allowed_in_pinned_mode_.find(action) ==
+ actions_allowed_in_pinned_mode_.end()) {
+ return RESTRICTION_PREVENT_PROCESSING_AND_PROPAGATION;
+ }
ash::Shell* shell = ash::Shell::GetInstance();
if (!shell->session_state_delegate()->IsActiveUserSessionStarted() &&
actions_allowed_at_login_screen_.find(action) ==
« no previous file with comments | « ash/accelerators/accelerator_controller.h ('k') | ash/accelerators/accelerator_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698