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

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

Issue 224113005: Eliminate ash::internal namespace (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ash/wm/workspace/magnetism_matcher.h ('k') | ash/wm/workspace/magnetism_matcher_unittest.cc » ('j') | 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/magnetism_matcher.h" 5 #include "ash/wm/workspace/magnetism_matcher.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <cmath> 8 #include <cmath>
9 9
10 namespace ash { 10 namespace ash {
11 namespace internal {
12
13 namespace { 11 namespace {
14 12
15 // Returns true if |a| is close enough to |b| that the two edges snap. 13 // Returns true if |a| is close enough to |b| that the two edges snap.
16 bool IsCloseEnough(int a, int b) { 14 bool IsCloseEnough(int a, int b) {
17 return abs(a - b) <= MagnetismMatcher::kMagneticDistance; 15 return abs(a - b) <= MagnetismMatcher::kMagneticDistance;
18 } 16 }
19 17
20 // Returns true if the specified SecondaryMagnetismEdge can be matched with a 18 // Returns true if the specified SecondaryMagnetismEdge can be matched with a
21 // primary edge of |primary|. |edges| is a bitmask of the allowed 19 // primary edge of |primary|. |edges| is a bitmask of the allowed
22 // MagnetismEdges. 20 // MagnetismEdges.
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
183 } else if (CanMatchSecondaryEdge(edge, SECONDARY_MAGNETISM_EDGE_TRAILING, 181 } else if (CanMatchSecondaryEdge(edge, SECONDARY_MAGNETISM_EDGE_TRAILING,
184 edges_) && 182 edges_) &&
185 IsCloseEnough(bounds.right(), src_bounds.right())) { 183 IsCloseEnough(bounds.right(), src_bounds.right())) {
186 *secondary_edge = SECONDARY_MAGNETISM_EDGE_TRAILING; 184 *secondary_edge = SECONDARY_MAGNETISM_EDGE_TRAILING;
187 } else { 185 } else {
188 *secondary_edge = SECONDARY_MAGNETISM_EDGE_NONE; 186 *secondary_edge = SECONDARY_MAGNETISM_EDGE_NONE;
189 } 187 }
190 } 188 }
191 } 189 }
192 190
193 } // namespace internal
194 } // namespace ash 191 } // namespace ash
OLDNEW
« no previous file with comments | « ash/wm/workspace/magnetism_matcher.h ('k') | ash/wm/workspace/magnetism_matcher_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698