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

Unified Diff: ash/wm/default_window_resizer.cc

Issue 121153003: Prevents panels attached to shelf from docking (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Prevents panels attached to shelf from docking (nits) Created 6 years, 11 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/wm/default_window_resizer.h ('k') | ash/wm/dock/docked_window_layout_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/wm/default_window_resizer.cc
diff --git a/ash/wm/default_window_resizer.cc b/ash/wm/default_window_resizer.cc
index 97dbbe7773a4020c7636e317eabf2285a98b0037..ac0042d000e9482149de1b1fd50a7d5c4ee8f234 100644
--- a/ash/wm/default_window_resizer.cc
+++ b/ash/wm/default_window_resizer.cc
@@ -22,21 +22,17 @@ DefaultWindowResizer::~DefaultWindowResizer() {
// static
DefaultWindowResizer*
-DefaultWindowResizer::Create(aura::Window* window,
- const gfx::Point& location,
- int window_component,
- aura::client::WindowMoveSource source) {
- Details details(window, location, window_component, source);
- return details.is_resizable ? new DefaultWindowResizer(details) : NULL;
+DefaultWindowResizer::Create(wm::WindowState* window_state) {
+ return new DefaultWindowResizer(window_state);
}
void DefaultWindowResizer::Drag(const gfx::Point& location, int event_flags) {
- gfx::Rect bounds(CalculateBoundsForDrag(details_, location));
- if (bounds != details_.window->bounds()) {
- if (!did_move_or_resize_ && !details_.restore_bounds.IsEmpty())
- wm::GetWindowState(details_.window)->ClearRestoreBounds();
+ gfx::Rect bounds(CalculateBoundsForDrag(location));
+ if (bounds != GetTarget()->bounds()) {
+ if (!did_move_or_resize_ && !details().restore_bounds.IsEmpty())
+ window_state_->ClearRestoreBounds();
did_move_or_resize_ = true;
- details_.window->SetBounds(bounds);
+ GetTarget()->SetBounds(bounds);
}
}
@@ -47,25 +43,16 @@ void DefaultWindowResizer::RevertDrag() {
if (!did_move_or_resize_)
return;
- details_.window->SetBounds(details_.initial_bounds_in_parent);
+ GetTarget()->SetBounds(details().initial_bounds_in_parent);
- if (!details_.restore_bounds.IsEmpty())
- wm::GetWindowState(details_.window)->SetRestoreBoundsInScreen(
- details_.restore_bounds);
+ if (!details().restore_bounds.IsEmpty())
+ window_state_->SetRestoreBoundsInScreen(details().restore_bounds);
}
-aura::Window* DefaultWindowResizer::GetTarget() {
- return details_.window;
-}
-
-const gfx::Point& DefaultWindowResizer::GetInitialLocation() const {
- return details_.initial_location_in_parent;
-}
-
-DefaultWindowResizer::DefaultWindowResizer(const Details& details)
- : details_(details),
+DefaultWindowResizer::DefaultWindowResizer(wm::WindowState* window_state)
+ : WindowResizer(window_state),
did_move_or_resize_(false) {
- DCHECK(details_.is_resizable);
+ DCHECK(details().is_resizable);
ash::Shell::GetInstance()->cursor_manager()->LockCursor();
}
« no previous file with comments | « ash/wm/default_window_resizer.h ('k') | ash/wm/dock/docked_window_layout_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698