diff options
author | vollick@chromium.org <vollick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-11-07 19:26:30 +0000 |
---|---|---|
committer | vollick@chromium.org <vollick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-11-07 19:26:30 +0000 |
commit | 2ddfe43ba403bd2272154b2307e631d7394b55c3 (patch) | |
tree | b736178f711282c82a5b28f5ff47990dd90b79fe /views | |
parent | 554890fecb9712a3e7a99c5c82ca5b3d4f06f0d5 (diff) | |
download | chromium_src-2ddfe43ba403bd2272154b2307e631d7394b55c3.zip chromium_src-2ddfe43ba403bd2272154b2307e631d7394b55c3.tar.gz chromium_src-2ddfe43ba403bd2272154b2307e631d7394b55c3.tar.bz2 |
Reenable triggering of screen rotations by sensors.
Depends on http://codereview.chromium.org/8395046
BUG=None
TEST=Visiting about:rotate?right, about:rotate?left, etc. should cause the appropriate screen rotations.
Review URL: http://codereview.chromium.org/8402002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@108889 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views')
-rw-r--r-- | views/desktop/desktop_window_view.cc | 22 | ||||
-rw-r--r-- | views/desktop/desktop_window_view.h | 16 |
2 files changed, 37 insertions, 1 deletions
diff --git a/views/desktop/desktop_window_view.cc b/views/desktop/desktop_window_view.cc index 94fda7d..9ad146c 100644 --- a/views/desktop/desktop_window_view.cc +++ b/views/desktop/desktop_window_view.cc @@ -269,5 +269,27 @@ NonClientFrameView* DesktopWindowView::CreateNonClientFrameView() { return NULL; } +//////////////////////////////////////////////////////////////////////////////// +// ui::LayerAnimationObserver Implementation: + +void DesktopWindowView::OnLayerAnimationEnded( + const ui::LayerAnimationSequence* animation) { + // The layer, and all the observers should be notified of the + // transformed size of the desktop. + if (widget_) { + gfx::Rect current_bounds(widget_->GetClientAreaScreenBounds().size()); + layer()->transform().TransformRect(¤t_bounds); + SetBoundsRect(gfx::Rect(current_bounds.size())); + } +} + +void DesktopWindowView::OnLayerAnimationScheduled( + const ui::LayerAnimationSequence* animation) { +} + +void DesktopWindowView::OnLayerAnimationAborted( + const ui::LayerAnimationSequence* animation) { +} + } // namespace desktop } // namespace views diff --git a/views/desktop/desktop_window_view.h b/views/desktop/desktop_window_view.h index fadc04e..54471c9 100644 --- a/views/desktop/desktop_window_view.h +++ b/views/desktop/desktop_window_view.h @@ -6,16 +6,22 @@ #define VIEWS_DESKTOP_DESKTOP_WINDOW_VIEW_H_ #include "base/observer_list.h" +#include "ui/gfx/compositor/layer_animation_observer.h" #include "views/view.h" #include "views/widget/widget_delegate.h" +namespace ui { +class LayerAnimationSequence; +} // namespace ui + namespace views { class NativeWidgetViews; class Widget; namespace desktop { -class DesktopWindowView : public WidgetDelegateView { +class DesktopWindowView : public WidgetDelegateView, + public ui::LayerAnimationObserver { public: // Observers can listen to various events on the desktop. class Observer { @@ -73,6 +79,14 @@ class DesktopWindowView : public WidgetDelegateView { virtual View* GetContentsView() OVERRIDE; virtual NonClientFrameView* CreateNonClientFrameView() OVERRIDE; + // Implementation of ui::LayerAnimationObserver: + virtual void OnLayerAnimationEnded( + const ui::LayerAnimationSequence* animation) OVERRIDE; + virtual void OnLayerAnimationScheduled( + const ui::LayerAnimationSequence* animation) OVERRIDE; + virtual void OnLayerAnimationAborted( + const ui::LayerAnimationSequence* animation) OVERRIDE; + ObserverList<Observer> observers_; DesktopType type_; Widget* widget_; |