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

Unified Diff: ash/common/accelerators/accelerator_controller.cc

Issue 2700523004: Remove docked windows entirely in M59. (Closed)
Patch Set: Rebase Created 3 years, 10 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
Index: ash/common/accelerators/accelerator_controller.cc
diff --git a/ash/common/accelerators/accelerator_controller.cc b/ash/common/accelerators/accelerator_controller.cc
index 2c3e2f353fbf82d66f0ec4cadb39c375234525cd..fcb0a102fddf80dad44244a24d9a984d9381ed06 100644
--- a/ash/common/accelerators/accelerator_controller.cc
+++ b/ash/common/accelerators/accelerator_controller.cc
@@ -297,14 +297,14 @@ bool CanHandleWindowSnapOrDock() {
}
void HandleWindowSnapOrDock(AcceleratorAction action) {
- if (action == WINDOW_CYCLE_SNAP_DOCK_LEFT)
+ if (action == WINDOW_CYCLE_SNAP_LEFT)
base::RecordAction(UserMetricsAction("Accel_Window_Snap_Left"));
else
base::RecordAction(UserMetricsAction("Accel_Window_Snap_Right"));
- const wm::WMEvent event(action == WINDOW_CYCLE_SNAP_DOCK_LEFT
- ? wm::WM_EVENT_CYCLE_SNAP_DOCK_LEFT
- : wm::WM_EVENT_CYCLE_SNAP_DOCK_RIGHT);
+ const wm::WMEvent event(action == WINDOW_CYCLE_SNAP_LEFT
+ ? wm::WM_EVENT_CYCLE_SNAP_LEFT
+ : wm::WM_EVENT_CYCLE_SNAP_RIGHT);
WmWindow* active_window = WmShell::Get()->GetActiveWindow();
DCHECK(active_window);
active_window->GetWindowState()->OnWMEvent(&event);
@@ -316,9 +316,7 @@ void HandleWindowMinimize() {
}
bool CanHandlePositionCenter() {
- // Docked windows do not support centering.
- WmWindow* active_window = WmShell::Get()->GetActiveWindow();
- return (active_window && !active_window->GetWindowState()->IsDocked());
+ return !!WmShell::Get()->GetActiveWindow();
}
void HandlePositionCenter() {
@@ -799,8 +797,8 @@ bool AcceleratorController::CanPerformAction(
return CanHandleToggleAppList(accelerator, previous_accelerator);
case TOGGLE_CAPS_LOCK:
return CanHandleToggleCapsLock(accelerator, previous_accelerator);
- case WINDOW_CYCLE_SNAP_DOCK_LEFT:
- case WINDOW_CYCLE_SNAP_DOCK_RIGHT:
+ case WINDOW_CYCLE_SNAP_LEFT:
+ case WINDOW_CYCLE_SNAP_RIGHT:
return CanHandleWindowSnapOrDock();
case WINDOW_POSITION_CENTER:
return CanHandlePositionCenter();
@@ -1063,8 +1061,8 @@ void AcceleratorController::PerformAction(AcceleratorAction action,
case VOLUME_UP:
HandleVolumeUp(volume_controller_.get(), accelerator);
break;
- case WINDOW_CYCLE_SNAP_DOCK_LEFT:
- case WINDOW_CYCLE_SNAP_DOCK_RIGHT:
+ case WINDOW_CYCLE_SNAP_LEFT:
+ case WINDOW_CYCLE_SNAP_RIGHT:
HandleWindowSnapOrDock(action);
break;
case WINDOW_MINIMIZE:

Powered by Google App Engine
This is Rietveld 408576698