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

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

Issue 2700523004: Remove docked windows entirely in M59. (Closed)
Patch Set: Rebase Created 3 years, 9 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_unittest.cc ('k') | ash/common/accelerators/accelerator_table.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/common/accelerators/accelerator_controller.cc
diff --git a/ash/common/accelerators/accelerator_controller.cc b/ash/common/accelerators/accelerator_controller.cc
index 7414376711b54dfdea8819259c50fff7143f37c9..0909bbbf7cd8ac8d6ff99ba066b26496991fcb0f 100644
--- a/ash/common/accelerators/accelerator_controller.cc
+++ b/ash/common/accelerators/accelerator_controller.cc
@@ -404,7 +404,7 @@ void HandleToggleOverview() {
WmShell::Get()->window_selector_controller()->ToggleOverview();
}
-bool CanHandleWindowSnapOrDock() {
+bool CanHandleWindowSnap() {
WmWindow* active_window = WmShell::Get()->GetActiveWindow();
if (!active_window)
return false;
@@ -415,15 +415,15 @@ bool CanHandleWindowSnapOrDock() {
!window_state->IsFullscreen());
}
-void HandleWindowSnapOrDock(AcceleratorAction action) {
- if (action == WINDOW_CYCLE_SNAP_DOCK_LEFT)
+void HandleWindowSnap(AcceleratorAction action) {
+ 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);
@@ -435,9 +435,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() != nullptr;
}
void HandlePositionCenter() {
@@ -922,9 +920,9 @@ 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:
- return CanHandleWindowSnapOrDock();
+ case WINDOW_CYCLE_SNAP_LEFT:
+ case WINDOW_CYCLE_SNAP_RIGHT:
+ return CanHandleWindowSnap();
case WINDOW_POSITION_CENTER:
return CanHandlePositionCenter();
@@ -1194,9 +1192,9 @@ 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:
- HandleWindowSnapOrDock(action);
+ case WINDOW_CYCLE_SNAP_LEFT:
+ case WINDOW_CYCLE_SNAP_RIGHT:
+ HandleWindowSnap(action);
break;
case WINDOW_MINIMIZE:
HandleWindowMinimize();
« no previous file with comments | « ash/accelerators/accelerator_controller_unittest.cc ('k') | ash/common/accelerators/accelerator_table.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698