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

Unified Diff: chrome/browser/ui/touch/frame/touch_browser_frame_view.h

Issue 7273073: Animated Rotation (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Created 9 years, 6 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
Index: chrome/browser/ui/touch/frame/touch_browser_frame_view.h
diff --git a/chrome/browser/ui/touch/frame/touch_browser_frame_view.h b/chrome/browser/ui/touch/frame/touch_browser_frame_view.h
index a680fbc603eb9dbe809e6334aa48b9e2fee951f5..71975a41b1132a56f7935ac661afbe1016136d47 100644
--- a/chrome/browser/ui/touch/frame/touch_browser_frame_view.h
+++ b/chrome/browser/ui/touch/frame/touch_browser_frame_view.h
@@ -8,6 +8,7 @@
#include "chrome/browser/tabs/tab_strip_model_observer.h"
#include "chrome/browser/ui/views/frame/opaque_browser_frame_view.h"
+#include "content/browser/sensors/provider.h"
#include "content/common/notification_observer.h"
#include "content/common/notification_registrar.h"
#include "ui/base/animation/animation_delegate.h"
@@ -27,6 +28,29 @@ namespace ui {
class SlideAnimation;
}
+class TouchBrowserFrameView;
+
+typedef void (TouchBrowserFrameView::*OrientationChangeFn)
+ (const sensors::ScreenOrientationChange*);
+
+class OrientationChangeHack : public sensors::Listener {
+ public:
+ OrientationChangeHack(TouchBrowserFrameView* frame,
+ OrientationChangeFn function);
+ virtual ~OrientationChangeHack();
+
+ virtual void SensorChanged(sensors::Channel channel,
+ const std::string& data);
+ void InjectSensorChanged(sensors::Channel channel, const std::string& data);
+
+ private:
+ scoped_refptr<sensors::Connection> connection_;
+ TouchBrowserFrameView* frame_;
+ OrientationChangeFn function_;
+
+ // copy and assignment are allowed.
+};
+
class TouchBrowserFrameView
: public OpaqueBrowserFrameView,
public views::FocusChangeListener,
@@ -96,12 +120,22 @@ class TouchBrowserFrameView
virtual void AnimationProgressed(const ui::Animation* animation);
virtual void AnimationEnded(const ui::Animation* animation);
+ // Orientation changed
+ void OnScreenOrientationChanged(
+ const sensors::ScreenOrientationChange* change);
+
bool keyboard_showing_;
int keyboard_height_;
bool focus_listener_added_;
KeyboardContainerView* keyboard_;
NotificationRegistrar registrar_;
+ // state for rotation.
+ sensors::ScreenOrientationChange::Side up_;
+ int original_width_;
+ int original_height_;
+ OrientationChangeHack hack_;
+
scoped_ptr<ui::SlideAnimation> animation_;
DISALLOW_COPY_AND_ASSIGN(TouchBrowserFrameView);

Powered by Google App Engine
This is Rietveld 408576698