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

Unified Diff: ui/aura_shell/toplevel_window_event_filter.cc

Issue 8755003: Maximize windows when double clicking their title bar. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 1 month 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
Index: ui/aura_shell/toplevel_window_event_filter.cc
===================================================================
--- ui/aura_shell/toplevel_window_event_filter.cc (revision 112237)
+++ ui/aura_shell/toplevel_window_event_filter.cc (working copy)
@@ -10,6 +10,7 @@
#include "ui/aura/event.h"
#include "ui/aura/window.h"
#include "ui/aura/window_delegate.h"
+#include "ui/aura_shell/window_util.h"
#include "ui/base/hit_test.h"
#include "ui/base/ui_base_types.h"
@@ -124,6 +125,12 @@
window_component == HTGROWBOX;
}
+void ToggleMaximizedState(aura::Window* window) {
+ window->SetIntProperty(aura::kShowStateKey,
+ IsWindowMaximized(window) ? ui::SHOW_STATE_NORMAL
+ : ui::SHOW_STATE_MAXIMIZED);
+}
+
} // namespace
ToplevelWindowEventFilter::ToplevelWindowEventFilter(aura::Window* owner)
@@ -152,6 +159,10 @@
// mouse-drag-release-press case, where the mouse is released and
// pressed without mouse move event.
UpdateWindowComponentForEvent(target, event);
+ if (window_component_ == HTCAPTION &&
+ event->flags() & ui::EF_IS_DOUBLE_CLICK) {
+ ToggleMaximizedState(target);
+ }
mouse_down_bounds_ = target->bounds();
mouse_down_offset_in_parent_ = event->location();
aura::Window::ConvertPointToWindow(target, target->parent(),

Powered by Google App Engine
This is Rietveld 408576698