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

Unified Diff: ash/wm/toplevel_window_event_handler.cc

Issue 24108003: [Cleanup] Rename WindowSettings to WindowState (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase fix Created 7 years, 3 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/wm/system_gesture_event_filter_unittest.cc ('k') | ash/wm/toplevel_window_event_handler_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/wm/toplevel_window_event_handler.cc
diff --git a/ash/wm/toplevel_window_event_handler.cc b/ash/wm/toplevel_window_event_handler.cc
index d58087d92312bdb72a318c2f9546ceee08643296..213f79d8093ed53276c2bcd47fff91c2363ad779 100644
--- a/ash/wm/toplevel_window_event_handler.cc
+++ b/ash/wm/toplevel_window_event_handler.cc
@@ -5,10 +5,9 @@
#include "ash/wm/toplevel_window_event_handler.h"
#include "ash/shell.h"
-#include "ash/wm/property_util.h"
#include "ash/wm/resize_shadow_controller.h"
#include "ash/wm/window_resizer.h"
-#include "ash/wm/window_settings.h"
+#include "ash/wm/window_state.h"
#include "ash/wm/window_util.h"
#include "ash/wm/workspace/snap_sizer.h"
#include "base/message_loop/message_loop.h"
@@ -104,10 +103,9 @@ void ToplevelWindowEventHandler::ScopedWindowResizer::OnWindowHierarchyChanging(
const HierarchyChangeParams& params) {
if (params.receiver != resizer_->GetTarget())
return;
-
- if (wm::GetWindowSettings(params.receiver)->continue_drag_after_reparent()) {
- wm::GetWindowSettings(params.receiver)->
- set_continue_drag_after_reparent(false);
+ wm::WindowState* state = wm::GetWindowState(params.receiver);
+ if (state->continue_drag_after_reparent()) {
+ state->set_continue_drag_after_reparent(false);
AddHandlers(params.new_parent);
} else {
handler_->CompleteDrag(DRAG_COMPLETE, 0);
@@ -118,7 +116,8 @@ void ToplevelWindowEventHandler::ScopedWindowResizer::OnWindowPropertyChanged(
aura::Window* window,
const void* key,
intptr_t old) {
- if (key == aura::client::kShowStateKey && !wm::IsWindowNormal(window))
+ if (key == aura::client::kShowStateKey &&
+ !wm::GetWindowState(window)->IsNormalShowState())
handler_->CompleteDrag(DRAG_COMPLETE, 0);
}
@@ -287,22 +286,24 @@ void ToplevelWindowEventHandler::OnGestureEvent(ui::GestureEvent* event) {
target->delegate()->GetNonClientComponent(event->location());
if (WindowResizer::GetBoundsChangeForWindowComponent(component) == 0)
return;
- if (!wm::IsWindowNormal(target))
+
+ wm::WindowState* window_state = wm::GetWindowState(target);
+ if (!window_state->IsNormalShowState())
return;
if (fabs(event->details().velocity_y()) >
kMinVertVelocityForWindowMinimize) {
// Minimize/maximize.
if (event->details().velocity_y() > 0 &&
- wm::CanMinimizeWindow(target)) {
- wm::MinimizeWindow(target);
- SetWindowAlwaysRestoresToRestoreBounds(target, true);
- SetRestoreBoundsInParent(target, pre_drag_window_bounds_);
- } else if (wm::CanMaximizeWindow(target)) {
- SetRestoreBoundsInParent(target, pre_drag_window_bounds_);
- wm::MaximizeWindow(target);
+ window_state->CanMinimize()) {
+ window_state->Minimize();
+ window_state->set_always_restores_to_restore_bounds(true);
+ window_state->SetRestoreBoundsInParent(pre_drag_window_bounds_);
+ } else if (window_state->CanMaximize()) {
+ window_state->SetRestoreBoundsInParent(pre_drag_window_bounds_);
+ window_state->Maximize();
}
- } else if (wm::CanSnapWindow(target) &&
+ } else if (window_state->CanSnap() &&
fabs(event->details().velocity_x()) >
kMinHorizVelocityForWindowSwipe) {
// Snap left/right.
« no previous file with comments | « ash/wm/system_gesture_event_filter_unittest.cc ('k') | ash/wm/toplevel_window_event_handler_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698