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

Unified Diff: ash/accelerators/accelerator_controller.cc

Issue 2078883003: Handle UNPIN operation 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_commands_unittest.cc ('k') | ash/accelerators/accelerator_table.h » ('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 5b5c70d5f54e1e5db1ba20bdfc90fedfdb4d0968..fb3f8e79490cca043854b79f0b2673e06f417816 100644
--- a/ash/accelerators/accelerator_controller.cc
+++ b/ash/accelerators/accelerator_controller.cc
@@ -547,6 +547,15 @@ void HandlePositionCenter() {
wm::CenterWindow(wm::GetActiveWindow());
}
+bool CanHandleUnpin() {
+ wm::WindowState* window_state = wm::GetActiveWindowState();
+ return window_state && window_state->IsPinned();
+}
+
+void HandleUnpin() {
+ accelerators::Unpin();
+}
+
#if defined(OS_CHROMEOS)
void HandleBrightnessDown(BrightnessControlDelegate* delegate,
const ui::Accelerator& accelerator) {
@@ -1032,6 +1041,8 @@ bool AcceleratorController::CanPerformAction(
return CanHandleWindowSnapOrDock();
case WINDOW_POSITION_CENTER:
return CanHandlePositionCenter();
+ case UNPIN:
+ return CanHandleUnpin();
#if defined(OS_CHROMEOS)
case DEBUG_ADD_REMOVE_DISPLAY:
case DEBUG_TOGGLE_TOUCH_PAD:
@@ -1287,6 +1298,9 @@ void AcceleratorController::PerformAction(AcceleratorAction action,
case WINDOW_POSITION_CENTER:
HandlePositionCenter();
break;
+ case UNPIN:
+ HandleUnpin();
+ break;
#if defined(OS_CHROMEOS)
case BRIGHTNESS_DOWN:
HandleBrightnessDown(brightness_control_delegate_.get(), accelerator);
« no previous file with comments | « ash/accelerators/accelerator_commands_unittest.cc ('k') | ash/accelerators/accelerator_table.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698