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

Unified Diff: ash/wm/workspace/frame_maximize_button.h

Issue 9706059: Centralizes snap sizing and implements spec'd behavior. Three resize (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Better comments Created 8 years, 9 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/ash.gyp ('k') | ash/wm/workspace/frame_maximize_button.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/wm/workspace/frame_maximize_button.h
diff --git a/ash/wm/workspace/frame_maximize_button.h b/ash/wm/workspace/frame_maximize_button.h
index 7dc9ca341db5a1eed8c6b20b7f3f0be9bfef041c..1a0264b9e29f2b3f372d1098291367f22b88e5c9 100644
--- a/ash/wm/workspace/frame_maximize_button.h
+++ b/ash/wm/workspace/frame_maximize_button.h
@@ -13,6 +13,7 @@ namespace ash {
namespace internal {
class PhantomWindowController;
+class SnapSizer;
}
// Button used for the maximize control on the frame. Handles snapping logic.
@@ -52,17 +53,19 @@ class ASH_EXPORT FrameMaximizeButton : public views::ImageButton {
void InstallEventFilter();
void UninstallEventFilter();
- // Updates |snap_type_| based on a mouse drag. The parameters are relative to
- // the mouse pressed location.
- void UpdateSnap(int delta_x, int delta_y);
+ // Updates |snap_type_| based on a mouse drag.
+ void UpdateSnap(const gfx::Point& location);
- // Returns the type of snap based on the specified coordaintes (relative to
- // the press location).
- SnapType SnapTypeForDelta(int delta_x, int delta_y) const;
+ // Returns the type of snap based on the specified location.
+ SnapType SnapTypeForLocation(const gfx::Point& location) const;
// Returns the bounds of the resulting window for the specified type.
gfx::Rect BoundsForType(SnapType type) const;
+ // Converts location to screen coordinates and returns it. These are the
+ // coordinates used by the SnapSizer.
+ gfx::Point LocationForSnapSizer(const gfx::Point& location) const;
+
// Snaps the window to the current snap position.
void Snap();
@@ -82,6 +85,8 @@ class ASH_EXPORT FrameMaximizeButton : public views::ImageButton {
// Current snap type.
SnapType snap_type_;
+ scoped_ptr<internal::SnapSizer> snap_sizer_;
+
scoped_ptr<EscapeEventFilter> escape_event_filter_;
DISALLOW_COPY_AND_ASSIGN(FrameMaximizeButton);
« no previous file with comments | « ash/ash.gyp ('k') | ash/wm/workspace/frame_maximize_button.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698