Index: athena/screen/screen_manager_impl.cc |
diff --git a/athena/screen/screen_manager_impl.cc b/athena/screen/screen_manager_impl.cc |
index 8522acfc7acd30404c8b2ce8aa0d88fad5963769..b04e7e7ad49dab52c80954866dc50ce7d1cf9608 100644 |
--- a/athena/screen/screen_manager_impl.cc |
+++ b/athena/screen/screen_manager_impl.cc |
@@ -14,10 +14,12 @@ |
#include "ui/aura/client/screen_position_client.h" |
#include "ui/aura/client/window_tree_client.h" |
#include "ui/aura/layout_manager.h" |
+#include "ui/aura/test/test_screen.h" |
#include "ui/aura/window.h" |
#include "ui/aura/window_property.h" |
#include "ui/aura/window_targeter.h" |
#include "ui/aura/window_tree_host.h" |
+#include "ui/gfx/screen.h" |
#include "ui/wm/core/base_focus_rules.h" |
#include "ui/wm/core/capture_controller.h" |
@@ -199,9 +201,12 @@ class ScreenManagerImpl : public ScreenManager { |
virtual aura::Window* CreateContainer(const ContainerParams& params) OVERRIDE; |
virtual aura::Window* GetContext() OVERRIDE { return root_window_; } |
virtual void SetBackgroundImage(const gfx::ImageSkia& image) OVERRIDE; |
+ virtual gfx::Display::Rotation GetRotation() OVERRIDE; |
+ virtual void SetRotation(gfx::Display::Rotation rotation) OVERRIDE; |
aura::Window* root_window_; |
aura::Window* background_window_; |
+ gfx::Display::Rotation rotation_; |
scoped_ptr<BackgroundController> background_controller_; |
scoped_ptr<aura::client::WindowTreeClient> window_tree_client_; |
@@ -213,7 +218,8 @@ class ScreenManagerImpl : public ScreenManager { |
}; |
ScreenManagerImpl::ScreenManagerImpl(aura::Window* root_window) |
- : root_window_(root_window) { |
+ : root_window_(root_window), |
+ rotation_(gfx::Display::ROTATE_0) { |
DCHECK(root_window_); |
DCHECK(!instance); |
instance = this; |
@@ -322,6 +328,21 @@ void ScreenManagerImpl::SetBackgroundImage(const gfx::ImageSkia& image) { |
background_controller_->SetImage(image); |
} |
+gfx::Display::Rotation ScreenManagerImpl::GetRotation() { |
+ return rotation_; |
+} |
+ |
+void ScreenManagerImpl::SetRotation(gfx::Display::Rotation rotation) { |
+ if (rotation == rotation_) |
+ return; |
+ |
+ rotation_ = rotation; |
+ // TODO(flackr): Use display manager to update display rotation: |
+ // http://crbug.com/401044. |
+ static_cast<aura::TestScreen*>(gfx::Screen::GetNativeScreen())-> |
+ SetDisplayRotation(rotation); |
+} |
+ |
} // namespace |
ScreenManager::ContainerParams::ContainerParams(const std::string& n, |