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

Unified Diff: ash/display/screen_orientation_controller_chromeos.cc

Issue 2784043002: cros: Treat set rotation for chrome.system.display API in touchview mode as if user rotation lock (Closed)
Patch Set: feedback Created 3 years, 9 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: ash/display/screen_orientation_controller_chromeos.cc
diff --git a/ash/display/screen_orientation_controller_chromeos.cc b/ash/display/screen_orientation_controller_chromeos.cc
index 43663a511df5d730862a028d5aa661bddf537ebe..24b540ae70e881948474d5a9a419cc51c5f67f2e 100644
--- a/ash/display/screen_orientation_controller_chromeos.cc
+++ b/ash/display/screen_orientation_controller_chromeos.cc
@@ -232,14 +232,13 @@ void ScreenOrientationController::ToggleUserRotationLock() {
.GetActiveRotation();
user_locked_orientation_ = RotationToOrientation(current_rotation);
}
- base::AutoReset<bool> auto_ignore_display_configuration_updates(
- &ignore_display_configuration_updates_, true);
- Shell::GetInstance()->display_manager()->RegisterDisplayRotationProperties(
- user_rotation_locked(), OrientationToRotation(user_locked_orientation_));
+ SetLockToOrientation(user_locked_orientation_);
+}
- ApplyLockForActiveWindow();
- for (auto& observer : observers_)
- observer.OnUserRotationLockChanged();
+void ScreenOrientationController::SetLockToRotation(
+ display::Display::Rotation rotation) {
+ user_locked_orientation_ = RotationToOrientation(rotation);
+ SetLockToOrientation(user_locked_orientation_);
}
void ScreenOrientationController::OnWindowActivated(ActivationReason reason,
@@ -357,6 +356,21 @@ void ScreenOrientationController::SetRotationLockedInternal(
rotation_locked_orientation_ = blink::WebScreenOrientationLockAny;
}
+void ScreenOrientationController::SetLockToOrientation(
+ blink::WebScreenOrientationLockType orientation) {
oshima 2017/03/30 04:46:00 this should be either SetLockToOrientation(orient
+ if (!display::Display::HasInternalDisplay())
+ return;
oshima 2017/03/30 04:46:00 you need to do this in SetLockToRotation if you up
+
+ base::AutoReset<bool> auto_ignore_display_configuration_updates(
+ &ignore_display_configuration_updates_, true);
+ Shell::GetInstance()->display_manager()->RegisterDisplayRotationProperties(
+ user_rotation_locked(), OrientationToRotation(user_locked_orientation_));
+
+ ApplyLockForActiveWindow();
+ for (auto& observer : observers_)
+ observer.OnUserRotationLockChanged();
+}
+
void ScreenOrientationController::LockRotation(
display::Display::Rotation rotation,
display::Display::RotationSource source) {
« no previous file with comments | « ash/display/screen_orientation_controller_chromeos.h ('k') | chrome/browser/extensions/display_info_provider_chromeos.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698