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

Unified Diff: ash/wm/gestures/two_finger_drag_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/gestures/system_pinch_handler.cc ('k') | ash/wm/overview/window_selector.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/wm/gestures/two_finger_drag_handler.cc
diff --git a/ash/wm/gestures/two_finger_drag_handler.cc b/ash/wm/gestures/two_finger_drag_handler.cc
index c379f54875b00243fe519933ec23f1812d29efde..d5e28d87644eb095ab65595c1fefed752d350394 100644
--- a/ash/wm/gestures/two_finger_drag_handler.cc
+++ b/ash/wm/gestures/two_finger_drag_handler.cc
@@ -5,6 +5,7 @@
#include "ash/wm/gestures/two_finger_drag_handler.h"
#include "ash/wm/window_resizer.h"
+#include "ash/wm/window_state.h"
#include "ash/wm/window_util.h"
#include "ash/wm/workspace/snap_sizer.h"
#include "ui/aura/client/window_types.h"
@@ -91,9 +92,11 @@ bool TwoFingerDragHandler::ProcessGestureEvent(aura::Window* target,
return false;
}
+ wm::WindowState* window_state = wm::GetWindowState(target);
+
if (event.type() == ui::ET_GESTURE_BEGIN &&
event.details().touch_points() == 2) {
- if (!window_resizer_.get() && wm::IsWindowNormal(target) &&
+ if (!window_resizer_.get() && window_state->IsNormalShowState() &&
target->type() == aura::client::WINDOW_TYPE_NORMAL) {
if (WindowComponentsAllowMoving(first_finger_hittest_,
target->delegate()->GetNonClientComponent(event.location()))) {
@@ -114,7 +117,7 @@ bool TwoFingerDragHandler::ProcessGestureEvent(aura::Window* target,
// Consume all two-finger gestures on a normal window.
return event.details().touch_points() == 2 &&
target->type() == aura::client::WINDOW_TYPE_NORMAL &&
- wm::IsWindowNormal(target);
+ window_state->IsNormalShowState();
}
if (target != window_resizer_->GetTarget())
@@ -135,14 +138,12 @@ bool TwoFingerDragHandler::ProcessGestureEvent(aura::Window* target,
// For a swipe, the window either maximizes, minimizes, or snaps. In this
// case, cancel the drag, and do the appropriate action.
Reset();
-
if (event.details().swipe_up()) {
- if (wm::CanMaximizeWindow(target))
- wm::MaximizeWindow(target);
- } else if (event.details().swipe_down() &&
- wm::CanMinimizeWindow(target)) {
- wm::MinimizeWindow(target);
- } else if (wm::CanSnapWindow(target)) {
+ if (window_state->CanMaximize())
+ window_state->Maximize();
+ } else if (event.details().swipe_down() && window_state->CanMinimize()) {
+ window_state->Minimize();
+ } else if (window_state->CanSnap()) {
ui::ScopedLayerAnimationSettings scoped_setter(
target->layer()->GetAnimator());
scoped_setter.SetPreemptionStrategy(
« no previous file with comments | « ash/wm/gestures/system_pinch_handler.cc ('k') | ash/wm/overview/window_selector.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698