| 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();
|
| }
|
|
|
|
|