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

Side by Side Diff: ash/wm/workspace/snap_sizer.h

Issue 10223014: Revert 133982 because it broke build on chromeos due to mid-air collision with 133961. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 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/window_util.cc ('k') | ash/wm/workspace/snap_sizer.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 #ifndef ASH_WM_WORKSPACE_SNAP_SIZER_H_ 5 #ifndef ASH_WM_WORKSPACE_SNAP_SIZER_H_
6 #define ASH_WM_WORKSPACE_SNAP_SIZER_H_ 6 #define ASH_WM_WORKSPACE_SNAP_SIZER_H_
7 #pragma once 7 #pragma once
8 8
9 #include "ash/ash_export.h" 9 #include "ash/ash_export.h"
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 20 matching lines...) Expand all
31 const gfx::Point& start, 31 const gfx::Point& start,
32 Edge edge, 32 Edge edge,
33 int grid_size); 33 int grid_size);
34 34
35 // Updates the target bounds based on a mouse move. 35 // Updates the target bounds based on a mouse move.
36 void Update(const gfx::Point& location); 36 void Update(const gfx::Point& location);
37 37
38 // Bounds to position the window at. 38 // Bounds to position the window at.
39 const gfx::Rect& target_bounds() const { return target_bounds_; } 39 const gfx::Rect& target_bounds() const { return target_bounds_; }
40 40
41 // Returns the appropriate snap bounds (e.g. if a window is already snapped,
42 // then it returns the next snap-bounds).
43 gfx::Rect GetSnapBounds(const gfx::Rect& bounds);
44
45 private: 41 private:
46 // Calculates the amount to increment by. This returns one of -1, 0 or 1 and 42 // Calculates the amount to increment by. This returns one of -1, 0 or 1 and
47 // is intended to by applied to |percent_index_|. |x| is the current 43 // is intended to by applied to |percent_index_|. |x| is the current
48 // x-coordinate, and |reference_x| is used to determine whether to increase 44 // x-coordinate, and |reference_x| is used to determine whether to increase
49 // or decrease the position. It's one of |last_adjust_x_| or |last_update_x_|. 45 // or decrease the position. It's one of |last_adjust_x_| or |last_update_x_|.
50 int CalculateIncrement(int x, int reference_x) const; 46 int CalculateIncrement(int x, int reference_x) const;
51 47
52 // Changes the bounds. |x| is the current x-coordinate and |delta| the amount 48 // Changes the bounds. |x| is the current x-coordinate and |delta| the amount
53 // to increase by. |delta| comes from CalculateIncrement() and is applied 49 // to increase by. |delta| comes from CalculateIncrement() and is applied
54 // to |percent_index_|. 50 // to |percent_index_|.
55 void ChangeBounds(int x, int delta); 51 void ChangeBounds(int x, int delta);
56 52
57 // Returns the target bounds based on the edge and |percent_index_|. 53 // Returns the target bounds based on the edge and |percent_index_|.
58 gfx::Rect GetTargetBounds() const; 54 gfx::Rect GetTargetBounds() const;
59 55
60 gfx::Rect GetTargetBoundsForPercent(int percent_index) const;
61
62 // Returns true if the specified point is along the edge of the screen. 56 // Returns true if the specified point is along the edge of the screen.
63 bool AlongEdge(int x) const; 57 bool AlongEdge(int x) const;
64 58
65 // Window being snapped. 59 // Window being snapped.
66 aura::Window* window_; 60 aura::Window* window_;
67 61
68 const Edge edge_; 62 const Edge edge_;
69 const int grid_size_; 63 const int grid_size_;
70 64
71 // Current target bounds for the snap. 65 // Current target bounds for the snap.
(...skipping 15 matching lines...) Expand all
87 // X-coordinate last supplied to Update(). 81 // X-coordinate last supplied to Update().
88 int last_update_x_; 82 int last_update_x_;
89 83
90 DISALLOW_COPY_AND_ASSIGN(SnapSizer); 84 DISALLOW_COPY_AND_ASSIGN(SnapSizer);
91 }; 85 };
92 86
93 } // namespace internal 87 } // namespace internal
94 } // namespace ash 88 } // namespace ash
95 89
96 #endif // ASH_WM_WORKSPACE_SNAP_SIZER_H_ 90 #endif // ASH_WM_WORKSPACE_SNAP_SIZER_H_
OLDNEW
« no previous file with comments | « ash/wm/window_util.cc ('k') | ash/wm/workspace/snap_sizer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698