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

Side by Side Diff: ash/wm/drag_window_resizer.cc

Issue 13896026: Stick windows to sides of workspaces (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Dock with zero width (exposing DragWindowResizer for tests, rebase) Created 7 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 unified diff | Download patch
OLDNEW
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/wm/drag_window_resizer.h" 5 #include "ash/wm/drag_window_resizer.h"
6 6
7 #include "ash/display/mouse_cursor_event_filter.h" 7 #include "ash/display/mouse_cursor_event_filter.h"
8 #include "ash/screen_ash.h" 8 #include "ash/screen_ash.h"
9 #include "ash/shell.h" 9 #include "ash/shell.h"
10 #include "ash/wm/coordinate_conversion.h" 10 #include "ash/wm/coordinate_conversion.h"
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 next_window_resizer_->RevertDrag(); 118 next_window_resizer_->RevertDrag();
119 119
120 drag_window_controller_.reset(); 120 drag_window_controller_.reset();
121 GetTarget()->layer()->SetOpacity(details_.initial_opacity); 121 GetTarget()->layer()->SetOpacity(details_.initial_opacity);
122 } 122 }
123 123
124 aura::Window* DragWindowResizer::GetTarget() { 124 aura::Window* DragWindowResizer::GetTarget() {
125 return next_window_resizer_->GetTarget(); 125 return next_window_resizer_->GetTarget();
126 } 126 }
127 127
128 const gfx::Point& DragWindowResizer::GetInitialLocationForTest() const {
129 return details_.initial_location_in_parent;
130 }
131
128 DragWindowResizer::DragWindowResizer(WindowResizer* next_window_resizer, 132 DragWindowResizer::DragWindowResizer(WindowResizer* next_window_resizer,
129 const Details& details) 133 const Details& details)
130 : next_window_resizer_(next_window_resizer), 134 : next_window_resizer_(next_window_resizer),
131 details_(details), 135 details_(details),
132 destroyed_(NULL) { 136 destroyed_(NULL) {
133 // The pointer should be confined in one display during resizing a window 137 // The pointer should be confined in one display during resizing a window
134 // because the window cannot span two displays at the same time anyway. The 138 // because the window cannot span two displays at the same time anyway. The
135 // exception is window/tab dragging operation. During that operation, 139 // exception is window/tab dragging operation. During that operation,
136 // |mouse_warp_mode_| should be set to WARP_DRAG so that the user could move a 140 // |mouse_warp_mode_| should be set to WARP_DRAG so that the user could move a
137 // window/tab to another display. 141 // window/tab to another display.
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
190 194
191 bool DragWindowResizer::ShouldAllowMouseWarp() { 195 bool DragWindowResizer::ShouldAllowMouseWarp() {
192 return (details_.window_component == HTCAPTION) && 196 return (details_.window_component == HTCAPTION) &&
193 !GetTarget()->transient_parent() && 197 !GetTarget()->transient_parent() &&
194 (GetTarget()->type() == aura::client::WINDOW_TYPE_NORMAL || 198 (GetTarget()->type() == aura::client::WINDOW_TYPE_NORMAL ||
195 GetTarget()->type() == aura::client::WINDOW_TYPE_PANEL); 199 GetTarget()->type() == aura::client::WINDOW_TYPE_PANEL);
196 } 200 }
197 201
198 } // namespace internal 202 } // namespace internal
199 } // namespace ash 203 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698