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

Unified Diff: mash/simple_wm/move_loop.cc

Issue 2587183002: Adds sizing, maximizing, minimizing to simple_wm (Closed)
Patch Set: . Created 4 years 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 | « mash/simple_wm/move_loop.h ('k') | mash/simple_wm/simple_wm.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mash/simple_wm/move_loop.cc
diff --git a/mash/simple_wm/move_loop.cc b/mash/simple_wm/move_loop.cc
index 229b0cada9ca606c14fe490a4092c185c9720dac..8445585d69fdf93f0a2060d8332082e191b55d56 100644
--- a/mash/simple_wm/move_loop.cc
+++ b/mash/simple_wm/move_loop.cc
@@ -6,8 +6,10 @@
#include "base/auto_reset.h"
#include "base/memory/ptr_util.h"
+#include "ui/aura/client/aura_constants.h"
#include "ui/aura/window.h"
#include "ui/base/hit_test.h"
+#include "ui/base/ui_base_types.h"
#include "ui/events/event.h"
#include "ui/gfx/geometry/point_conversions.h"
#include "ui/gfx/geometry/rect.h"
@@ -159,6 +161,21 @@ bool MoveLoop::DetermineType(int ht_location,
}
void MoveLoop::MoveImpl(const ui::PointerEvent& event) {
+ ui::WindowShowState show_state =
+ target_->GetProperty(aura::client::kShowStateKey);
+ // TODO(beng): figure out if there might not be another place to put this,
+ // perhaps prior to move loop creation.
+ if (show_state == ui::SHOW_STATE_MAXIMIZED) {
+ base::AutoReset<bool> resetter(&changing_bounds_, true);
+ target_->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_NORMAL);
+ gfx::Rect restored_bounds =
+ *target_->GetProperty(aura::client::kRestoreBoundsKey);
+ // TODO(beng): Not just enough to adjust width and height, probably also
+ // need to take some action to recenter the window relative to
+ // the pointer position within the titlebar.
+ initial_window_bounds_.set_width(restored_bounds.width());
+ initial_window_bounds_.set_height(restored_bounds.height());
+ }
const gfx::Vector2d delta =
event.root_location() - initial_event_screen_location_;
const gfx::Rect new_bounds(DetermineBoundsFromDelta(delta));
« no previous file with comments | « mash/simple_wm/move_loop.h ('k') | mash/simple_wm/simple_wm.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698