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

Unified Diff: ash/wm/common/workspace/magnetism_matcher.cc

Issue 1933303002: Moves windowsresizers to ash/wm/common (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: WorkspaceWindowResizer Created 4 years, 8 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/common/workspace/magnetism_matcher.cc
diff --git a/ash/wm/workspace/magnetism_matcher.cc b/ash/wm/common/workspace/magnetism_matcher.cc
similarity index 93%
rename from ash/wm/workspace/magnetism_matcher.cc
rename to ash/wm/common/workspace/magnetism_matcher.cc
index 18e20cbc994999b67b12b2897f9ef060b4a1ca57..e46bc263ba99ae0095a34293e07517cd741529e6 100644
--- a/ash/wm/workspace/magnetism_matcher.cc
+++ b/ash/wm/common/workspace/magnetism_matcher.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "ash/wm/workspace/magnetism_matcher.h"
+#include "ash/wm/common/workspace/magnetism_matcher.h"
#include <algorithm>
#include <cmath>
@@ -52,13 +52,11 @@ bool CanMatchSecondaryEdge(MagnetismEdge primary,
MagnetismEdgeMatcher::MagnetismEdgeMatcher(const gfx::Rect& bounds,
MagnetismEdge edge)
- : bounds_(bounds),
- edge_(edge) {
+ : bounds_(bounds), edge_(edge) {
ranges_.push_back(GetSecondaryRange(bounds_));
}
-MagnetismEdgeMatcher::~MagnetismEdgeMatcher() {
-}
+MagnetismEdgeMatcher::~MagnetismEdgeMatcher() {}
bool MagnetismEdgeMatcher::ShouldAttach(const gfx::Rect& bounds) {
if (is_edge_obscured())
@@ -94,9 +92,8 @@ void MagnetismEdgeMatcher::UpdateRanges(const Range& range) {
return;
for (size_t i = it - ranges_.begin();
- i < ranges_.size() && RangesIntersect(ranges_[i], range); ) {
- if (range.first <= ranges_[i].first &&
- range.second >= ranges_[i].second) {
+ i < ranges_.size() && RangesIntersect(ranges_[i], range);) {
+ if (range.first <= ranges_[i].first && range.second >= ranges_[i].second) {
ranges_.erase(ranges_.begin() + i);
} else if (range.first < ranges_[i].first) {
DCHECK_GT(range.second, ranges_[i].first);
@@ -127,15 +124,14 @@ MagnetismMatcher::MagnetismMatcher(const gfx::Rect& bounds, uint32_t edges)
if (edges & MAGNETISM_EDGE_LEFT)
matchers_.push_back(new MagnetismEdgeMatcher(bounds, MAGNETISM_EDGE_LEFT));
if (edges & MAGNETISM_EDGE_BOTTOM) {
- matchers_.push_back(new MagnetismEdgeMatcher(bounds,
- MAGNETISM_EDGE_BOTTOM));
+ matchers_.push_back(
+ new MagnetismEdgeMatcher(bounds, MAGNETISM_EDGE_BOTTOM));
}
if (edges & MAGNETISM_EDGE_RIGHT)
matchers_.push_back(new MagnetismEdgeMatcher(bounds, MAGNETISM_EDGE_RIGHT));
}
-MagnetismMatcher::~MagnetismMatcher() {
-}
+MagnetismMatcher::~MagnetismMatcher() {}
bool MagnetismMatcher::ShouldAttach(const gfx::Rect& bounds,
MatchedEdge* edge) {

Powered by Google App Engine
This is Rietveld 408576698