Index: ash/wm/caption_buttons/alternate_frame_size_button.cc |
diff --git a/ash/wm/caption_buttons/alternate_frame_size_button.cc b/ash/wm/caption_buttons/alternate_frame_size_button.cc |
index 24f9a0ad90be5a162b2de09cc2aa520946e83956..044e7a3a69b5c9c10cee4036c823e6cb79e520a4 100644 |
--- a/ash/wm/caption_buttons/alternate_frame_size_button.cc |
+++ b/ash/wm/caption_buttons/alternate_frame_size_button.cc |
@@ -8,6 +8,7 @@ |
#include "ash/shell.h" |
#include "ash/touch/touch_uma.h" |
#include "ash/wm/window_state.h" |
+#include "ash/wm/workspace/phantom_window_controller.h" |
#include "ash/wm/workspace/snap_sizer.h" |
#include "ui/gfx/vector2d.h" |
#include "ui/views/widget/widget.h" |
@@ -176,6 +177,24 @@ void AlternateFrameSizeButton::UpdatePressedButton( |
break; |
} |
} |
+ |
+ if (snap_type_ == SNAP_LEFT || snap_type_ == SNAP_RIGHT) { |
+ if (!phantom_window_controller_.get()) { |
+ phantom_window_controller_.reset( |
+ new internal::PhantomWindowController(frame_->GetNativeWindow())); |
+ } |
+ |
+ using internal::SnapSizer; |
+ SnapSizer snap_sizer(wm::GetWindowState(frame_->GetNativeWindow()), |
+ gfx::Point(), |
+ snap_type_ == SNAP_LEFT ? |
+ SnapSizer::LEFT_EDGE : SnapSizer::RIGHT_EDGE, |
+ SnapSizer::OTHER_INPUT); |
+ phantom_window_controller_->Show(snap_sizer.target_bounds()); |
+ } else { |
+ if (phantom_window_controller_.get()) |
+ phantom_window_controller_->StartFadeOut(); |
+ } |
} |
bool AlternateFrameSizeButton::CommitSnap(const ui::LocatedEvent& event) { |
@@ -206,6 +225,7 @@ void AlternateFrameSizeButton::SetButtonsToNormalMode( |
snap_type_ = SNAP_NONE; |
set_buttons_to_snap_mode_timer_.Stop(); |
delegate_->SetButtonsToNormal(animate); |
+ phantom_window_controller_.reset(); |
} |
} // namespace ash |