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

Unified Diff: athena/screen/screen_manager_impl.cc

Issue 535973002: Disable screen rotation when splitview is engaged and only allow splitview in landscape. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nits Created 6 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 | « athena/screen/public/screen_manager.h ('k') | athena/wm/split_view_controller.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: athena/screen/screen_manager_impl.cc
diff --git a/athena/screen/screen_manager_impl.cc b/athena/screen/screen_manager_impl.cc
index f37d99bd4c2139c275f98b5b9ccea6920df4d09b..20d655bf349260f047a80913e5ba8f6660ac327c 100644
--- a/athena/screen/screen_manager_impl.cc
+++ b/athena/screen/screen_manager_impl.cc
@@ -203,6 +203,7 @@ class ScreenManagerImpl : public ScreenManager {
virtual aura::Window* CreateContainer(const ContainerParams& params) OVERRIDE;
virtual aura::Window* GetContext() OVERRIDE { return root_window_; }
virtual void SetRotation(gfx::Display::Rotation rotation) OVERRIDE;
+ virtual void SetRotationLocked(bool rotation_locked) OVERRIDE;
virtual ui::LayerAnimator* GetScreenAnimator() OVERRIDE;
// Not owned.
@@ -214,11 +215,16 @@ class ScreenManagerImpl : public ScreenManager {
scoped_ptr< ::wm::ScopedCaptureClient> capture_client_;
scoped_ptr<aura::client::ScreenPositionClient> screen_position_client_;
+ gfx::Display::Rotation last_requested_rotation_;
+ bool rotation_locked_;
+
DISALLOW_COPY_AND_ASSIGN(ScreenManagerImpl);
};
ScreenManagerImpl::ScreenManagerImpl(aura::Window* root_window)
- : root_window_(root_window) {
+ : root_window_(root_window),
+ last_requested_rotation_(gfx::Display::ROTATE_0),
+ rotation_locked_(false) {
DCHECK(root_window_);
DCHECK(!instance);
instance = this;
@@ -329,7 +335,8 @@ aura::Window* ScreenManagerImpl::CreateContainer(
}
void ScreenManagerImpl::SetRotation(gfx::Display::Rotation rotation) {
- if (rotation ==
+ last_requested_rotation_ = rotation;
+ if (rotation_locked_ || rotation ==
gfx::Screen::GetNativeScreen()->GetPrimaryDisplay().rotation()) {
return;
}
@@ -340,6 +347,12 @@ void ScreenManagerImpl::SetRotation(gfx::Display::Rotation rotation) {
SetDisplayRotation(rotation);
}
+void ScreenManagerImpl::SetRotationLocked(bool rotation_locked) {
+ rotation_locked_ = rotation_locked;
+ if (!rotation_locked_)
+ SetRotation(last_requested_rotation_);
+}
+
ui::LayerAnimator* ScreenManagerImpl::GetScreenAnimator() {
return root_window_->layer()->GetAnimator();
}
« no previous file with comments | « athena/screen/public/screen_manager.h ('k') | athena/wm/split_view_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698