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

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

Issue 9705039: Makes escape cancel a snap operation from the maximize button. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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 | « no previous file | 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 7d95d335e5fd3332b1729a9ec6c4db493b554e1b..7dc9ca341db5a1eed8c6b20b7f3f0be9bfef041c 100644
--- a/ash/wm/workspace/frame_maximize_button.h
+++ b/ash/wm/workspace/frame_maximize_button.h
@@ -34,6 +34,8 @@ class ASH_EXPORT FrameMaximizeButton : public views::ImageButton {
virtual SkBitmap GetImageToPaint() OVERRIDE;
private:
+ class EscapeEventFilter;
+
// Where to snap to.
enum SnapType {
SNAP_LEFT,
@@ -43,6 +45,13 @@ class ASH_EXPORT FrameMaximizeButton : public views::ImageButton {
SNAP_NONE
};
+ // Cancels snap behavior.
+ void Cancel();
+
+ // Installs/uninstalls an EventFilter to track when escape is pressed.
+ 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);
@@ -73,6 +82,8 @@ class ASH_EXPORT FrameMaximizeButton : public views::ImageButton {
// Current snap type.
SnapType snap_type_;
+ scoped_ptr<EscapeEventFilter> escape_event_filter_;
+
DISALLOW_COPY_AND_ASSIGN(FrameMaximizeButton);
};
« no previous file with comments | « no previous file | ash/wm/workspace/frame_maximize_button.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698