OLD | NEW |
---|---|
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_FRAME_MAXIMIZE_BUTTON_H_ | 5 #ifndef ASH_WM_WORKSPACE_FRAME_MAXIMIZE_BUTTON_H_ |
6 #define ASH_WM_WORKSPACE_FRAME_MAXIMIZE_BUTTON_H_ | 6 #define ASH_WM_WORKSPACE_FRAME_MAXIMIZE_BUTTON_H_ |
7 | 7 |
8 #include "ash/ash_export.h" | 8 #include "ash/ash_export.h" |
9 #include "ash/wm/workspace/snap_types.h" | 9 #include "ash/wm/workspace/snap_types.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
89 // |update_timer_|. | 89 // |update_timer_|. |
90 void UpdateSnapFromEventLocation(); | 90 void UpdateSnapFromEventLocation(); |
91 | 91 |
92 // Updates |snap_type_| based on a mouse drag. | 92 // Updates |snap_type_| based on a mouse drag. |
93 void UpdateSnap(const gfx::Point& location); | 93 void UpdateSnap(const gfx::Point& location); |
94 | 94 |
95 // Returns the type of snap based on the specified location. | 95 // Returns the type of snap based on the specified location. |
96 SnapType SnapTypeForLocation(const gfx::Point& location) const; | 96 SnapType SnapTypeForLocation(const gfx::Point& location) const; |
97 | 97 |
98 // Returns the bounds of the resulting window for the specified type. | 98 // Returns the bounds of the resulting window for the specified type. |
99 gfx::Rect ScreenBoundsForType(SnapType type) const; | 99 gfx::Rect ScreenBoundsForType(SnapType type, |
100 internal::SnapSizer* snap_sizer) const; | |
sky
2012/08/08 17:26:01
Make this and Snap take a const SnapSizer& (and re
Mr4D (OOO till 08-26)
2012/08/08 17:50:51
Done.
| |
100 | 101 |
101 // Converts location to screen coordinates and returns it. These are the | 102 // Converts location to screen coordinates and returns it. These are the |
102 // coordinates used by the SnapSizer. | 103 // coordinates used by the SnapSizer. |
103 gfx::Point LocationForSnapSizer(const gfx::Point& location) const; | 104 gfx::Point LocationForSnapSizer(const gfx::Point& location) const; |
104 | 105 |
105 // Snaps the window to the current snap position. | 106 // Snaps the window to the current snap position. |
106 void Snap(); | 107 void Snap(internal::SnapSizer* snap_sizer); |
107 | 108 |
108 // Frame that the maximize button acts on. | 109 // Frame that the maximize button acts on. |
109 views::NonClientFrameView* frame_; | 110 views::NonClientFrameView* frame_; |
110 | 111 |
111 // Renders the snap position. | 112 // Renders the snap position. |
112 scoped_ptr<internal::PhantomWindowController> phantom_window_; | 113 scoped_ptr<internal::PhantomWindowController> phantom_window_; |
113 | 114 |
114 // Is snapping enabled? Set on press so that in drag we know whether we | 115 // Is snapping enabled? Set on press so that in drag we know whether we |
115 // should show the snap locations. | 116 // should show the snap locations. |
116 bool is_snap_enabled_; | 117 bool is_snap_enabled_; |
(...skipping 17 matching lines...) Expand all Loading... | |
134 base::OneShotTimer<FrameMaximizeButton> update_timer_; | 135 base::OneShotTimer<FrameMaximizeButton> update_timer_; |
135 | 136 |
136 scoped_ptr<MaximizeBubbleController> maximizer_; | 137 scoped_ptr<MaximizeBubbleController> maximizer_; |
137 | 138 |
138 DISALLOW_COPY_AND_ASSIGN(FrameMaximizeButton); | 139 DISALLOW_COPY_AND_ASSIGN(FrameMaximizeButton); |
139 }; | 140 }; |
140 | 141 |
141 } // namespace ash | 142 } // namespace ash |
142 | 143 |
143 #endif // ASH_WM_WORKSPACE_FRAME_MAXIMIZE_BUTTON_H_ | 144 #endif // ASH_WM_WORKSPACE_FRAME_MAXIMIZE_BUTTON_H_ |
OLD | NEW |