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

Side by Side Diff: ash/wm/workspace/workspace_window_resizer.cc

Issue 1128933005: Revert of Adjusts dragging logic to be less likely to trigger false positive switch from snapping to docking (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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
« no previous file with comments | « ash/wm/workspace/workspace_window_resizer.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/workspace/workspace_window_resizer.h" 5 #include "ash/wm/workspace/workspace_window_resizer.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <cmath> 8 #include <cmath>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 923 matching lines...) Expand 10 before | Expand all | Expand 10 after
934 SetDraggedWindowDocked(false); 934 SetDraggedWindowDocked(false);
935 snap_type_ = GetSnapType(location); 935 snap_type_ = GetSnapType(location);
936 } 936 }
937 const bool can_snap = snap_type_ != SNAP_NONE && window_state()->CanSnap(); 937 const bool can_snap = snap_type_ != SNAP_NONE && window_state()->CanSnap();
938 if (!can_snap && !can_dock) { 938 if (!can_snap && !can_dock) {
939 snap_type_ = SNAP_NONE; 939 snap_type_ = SNAP_NONE;
940 snap_phantom_window_controller_.reset(); 940 snap_phantom_window_controller_.reset();
941 edge_cycler_.reset(); 941 edge_cycler_.reset();
942 return; 942 return;
943 } 943 }
944 if (!edge_cycler_) { 944 if (!edge_cycler_)
945 edge_cycler_.reset(new TwoStepEdgeCycler( 945 edge_cycler_.reset(new TwoStepEdgeCycler(location));
946 location, snap_type_ == SNAP_LEFT 946 else
947 ? TwoStepEdgeCycler::DIRECTION_LEFT
948 : TwoStepEdgeCycler::DIRECTION_RIGHT));
949 } else {
950 edge_cycler_->OnMove(location); 947 edge_cycler_->OnMove(location);
951 }
952 948
953 // Update phantom window with snapped or docked guide bounds. 949 // Update phantom window with snapped or docked guide bounds.
954 // Windows that cannot be snapped or are less wide than kMaxDockWidth can get 950 // Windows that cannot be snapped or are less wide than kMaxDockWidth can get
955 // docked without going through a snapping sequence. 951 // docked without going through a snapping sequence.
956 gfx::Rect phantom_bounds; 952 gfx::Rect phantom_bounds;
957 const bool should_dock = can_dock && 953 const bool should_dock = can_dock &&
958 (!can_snap || 954 (!can_snap ||
959 GetTarget()->bounds().width() <= 955 GetTarget()->bounds().width() <=
960 DockedWindowLayoutManager::kMaxDockWidth || 956 DockedWindowLayoutManager::kMaxDockWidth ||
961 edge_cycler_->use_second_mode() || 957 edge_cycler_->use_second_mode() ||
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
1054 snapped_type == wm::WINDOW_STATE_TYPE_RIGHT_SNAPPED); 1050 snapped_type == wm::WINDOW_STATE_TYPE_RIGHT_SNAPPED);
1055 gfx::Rect snapped_bounds = ScreenUtil::GetDisplayWorkAreaBoundsInParent( 1051 gfx::Rect snapped_bounds = ScreenUtil::GetDisplayWorkAreaBoundsInParent(
1056 GetTarget()); 1052 GetTarget());
1057 if (snapped_type == wm::WINDOW_STATE_TYPE_RIGHT_SNAPPED) 1053 if (snapped_type == wm::WINDOW_STATE_TYPE_RIGHT_SNAPPED)
1058 snapped_bounds.set_x(snapped_bounds.right() - bounds_in_parent.width()); 1054 snapped_bounds.set_x(snapped_bounds.right() - bounds_in_parent.width());
1059 snapped_bounds.set_width(bounds_in_parent.width()); 1055 snapped_bounds.set_width(bounds_in_parent.width());
1060 return bounds_in_parent == snapped_bounds; 1056 return bounds_in_parent == snapped_bounds;
1061 } 1057 }
1062 1058
1063 } // namespace ash 1059 } // namespace ash
OLDNEW
« no previous file with comments | « ash/wm/workspace/workspace_window_resizer.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698