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

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

Issue 23431009: Windows docking should get triggered by pressing against the screen edge (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Windows docking by pressing against the screen edge (rebase) Created 7 years, 3 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/workspace/snap_sizer.h ('k') | ash/wm/workspace/workspace_window_resizer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/wm/workspace/snap_sizer.cc
diff --git a/ash/wm/workspace/snap_sizer.cc b/ash/wm/workspace/snap_sizer.cc
index 8447fd2b42806604c74718b9507d9c6aa265e12f..e4bdaf7b3fcc20d44a3a68a3bd602c74082aab55 100644
--- a/ash/wm/workspace/snap_sizer.cc
+++ b/ash/wm/workspace/snap_sizer.cc
@@ -78,11 +78,11 @@ int GetDefaultWidth(aura::Window* window) {
return std::max(width, GetMinWidth(window));
}
-// Create the list of possible widths for the current screen configuration:
-// Fill the |usable_width_| list with items from |kIdealWidth| which fit on
-// the screen and supplement it with the 'half of screen' size. Furthermore,
-// add an entry for 90% of the screen size if it is smaller than the biggest
-// value in the |kIdealWidth| list (to get a step between the values).
+// Creates the list of possible width for the current screen configuration:
+// Returns a list with items from |kIdealWidth| which fit on the screen and
+// supplement it with the 'half of screen' size. Furthermore, add an entry for
+// 90% of the screen size if it is smaller than the biggest value in the
+// |kIdealWidth| list (to get a step between the values).
std::vector<int> BuildIdealWidthList(aura::Window* window) {
if (ash::switches::UseAlternateFrameCaptionButtonStyle()) {
// Only the 'half of screen' width is supported when using the alternate
@@ -133,6 +133,7 @@ SnapSizer::SnapSizer(aura::Window* window,
edge_(edge),
time_last_update_(base::TimeTicks::Now()),
size_index_(0),
+ end_of_sequence_(false),
resize_disabled_(false),
num_moves_since_adjust_(0),
last_adjust_x_(start.x()),
@@ -218,6 +219,7 @@ gfx::Rect SnapSizer::GetSnapBounds(const gfx::Rect& bounds) {
void SnapSizer::SelectDefaultSizeAndDisableResize() {
resize_disabled_ = true;
size_index_ = 0;
+ end_of_sequence_ = false;
target_bounds_ = GetTargetBounds();
}
@@ -260,6 +262,8 @@ int SnapSizer::CalculateIncrement(int x, int reference_x) const {
}
void SnapSizer::ChangeBounds(int x, int delta) {
+ end_of_sequence_ =
+ delta > 0 && size_index_ == static_cast<int>(usable_width_.size()) - 1;
int index = std::min(static_cast<int>(usable_width_.size()) - 1,
std::max(size_index_ + delta, 0));
if (index != size_index_) {
@@ -275,7 +279,7 @@ gfx::Rect SnapSizer::GetTargetBounds() const {
}
bool SnapSizer::AlongEdge(int x) const {
- gfx::Rect area(ScreenAsh::GetDisplayBoundsInParent(window_));
+ gfx::Rect area(ScreenAsh::GetDisplayWorkAreaBoundsInParent(window_));
return (x <= area.x()) || (x >= area.right() - 1);
}
« no previous file with comments | « ash/wm/workspace/snap_sizer.h ('k') | ash/wm/workspace/workspace_window_resizer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698