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

Unified Diff: ash/wm/gestures/system_pinch_handler.cc

Issue 10937038: gesture recognizer: Recognizer rotation gestures. Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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 | « no previous file | ui/base/gestures/gesture_sequence.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/wm/gestures/system_pinch_handler.cc
diff --git a/ash/wm/gestures/system_pinch_handler.cc b/ash/wm/gestures/system_pinch_handler.cc
index d974addc6ba1fd2669a03a60fca1c96704242a5f..1feed30516627daf3738040840ec268ef645ae52 100644
--- a/ash/wm/gestures/system_pinch_handler.cc
+++ b/ash/wm/gestures/system_pinch_handler.cc
@@ -4,6 +4,8 @@
#include "ash/wm/gestures/system_pinch_handler.h"
+#include <math.h>
+
#include "ash/launcher/launcher.h"
#include "ash/screen_ash.h"
#include "ash/shell.h"
@@ -48,6 +50,8 @@ SystemGestureStatus SystemPinchHandler::ProcessGestureEvent(
if (event.details().touch_points() > kSystemGesturePoints)
break;
+ target_->SetTransform(ui::Transform());
+
if (phantom_state_ == PHANTOM_WINDOW_MAXIMIZED) {
if (!wm::IsWindowMaximized(target_) &&
!wm::IsWindowFullscreen(target_))
@@ -74,6 +78,12 @@ SystemGestureStatus SystemPinchHandler::ProcessGestureEvent(
GetPhantomWindowScreenBounds(target_, event.location());
if (phantom_state_ != PHANTOM_WINDOW_NORMAL || phantom_.IsShowing())
phantom_.Show(bounds, NULL);
+
+ float rotation = event.details().rotation();
+ LOG(ERROR) << "Rotation: " << rotation;
+ ui::Transform transform = target_->layer()->transform();
+ transform.ConcatRotate(-rotation * 180 / M_PI);
+ target_->SetTransform(transform);
break;
}
« no previous file with comments | « no previous file | ui/base/gestures/gesture_sequence.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698