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

Unified Diff: ash/wm/workspace/workspace_window_resizer.cc

Issue 23471004: Only support left/right maximizing at 50% width when the --ash-enable-alternate-caption-button (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Patch is now friendlier to pending docking changes Created 7 years, 4 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
Index: ash/wm/workspace/workspace_window_resizer.cc
diff --git a/ash/wm/workspace/workspace_window_resizer.cc b/ash/wm/workspace/workspace_window_resizer.cc
index 4b8c0aaf7e9366f91aa1fd1bf6f8d88f9429b0c9..aaa69c7bfd24116ec932bf7ea2b71c25d988f744 100644
--- a/ash/wm/workspace/workspace_window_resizer.cc
+++ b/ash/wm/workspace/workspace_window_resizer.cc
@@ -422,8 +422,7 @@ void WorkspaceWindowResizer::CompleteDrag(int event_flags) {
initial_bounds :
details_.restore_bounds);
}
- window()->SetBounds(snap_sizer_->target_bounds());
- return;
+ snap_sizer_->Snap();
}
}
@@ -855,9 +854,6 @@ void WorkspaceWindowResizer::UpdateSnapPhantomWindow(const gfx::Point& location,
if (!did_move_or_resize_ || details_.window_component != HTCAPTION)
return;
- if (!wm::CanSnapWindow(window()))
- return;
-
if (window()->type() == aura::client::WINDOW_TYPE_PANEL &&
window()->GetProperty(kPanelAttachedKey)) {
return;
@@ -865,25 +861,26 @@ void WorkspaceWindowResizer::UpdateSnapPhantomWindow(const gfx::Point& location,
SnapType last_type = snap_type_;
snap_type_ = GetSnapType(location);
- if (snap_type_ == SNAP_NONE || snap_type_ != last_type) {
+ using internal::SnapSizer;
+ SnapSizer::Edge edge = (snap_type_ == SNAP_LEFT_EDGE) ?
+ SnapSizer::LEFT_EDGE : SnapSizer::RIGHT_EDGE;
+ if (snap_type_ == SNAP_NONE ||
+ !SnapSizer::CanSnapWindow(window(), edge)) {
+ snap_type_ = SNAP_NONE;
snap_phantom_window_controller_.reset();
snap_sizer_.reset();
- if (snap_type_ == SNAP_NONE)
- return;
- }
- if (!snap_sizer_) {
- SnapSizer::Edge edge = (snap_type_ == SNAP_LEFT_EDGE) ?
- SnapSizer::LEFT_EDGE : SnapSizer::RIGHT_EDGE;
- snap_sizer_.reset(new SnapSizer(window(),
- location,
- edge,
- internal::SnapSizer::OTHER_INPUT));
- } else {
- snap_sizer_->Update(location);
+ return;
}
- if (!snap_phantom_window_controller_) {
+
+ if (snap_type_ != last_type ||
varkha 2013/08/30 17:13:25 Will the animations be smoother if we don't re-cre
pkotwicz 2013/08/30 21:10:57 I believe that you always transition through SNAP_
+ !snap_sizer_ ||
+ !snap_phantom_window_controller_) {
+ snap_sizer_.reset(
+ new SnapSizer(window(), location, edge, SnapSizer::STEP_YES));
snap_phantom_window_controller_.reset(
new PhantomWindowController(window()));
+ } else {
+ snap_sizer_->Update(location);
}
snap_phantom_window_controller_->Show(ScreenAsh::ConvertRectToScreen(
window()->parent(), snap_sizer_->target_bounds()));

Powered by Google App Engine
This is Rietveld 408576698