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

Unified Diff: ash/content/display/screen_orientation_controller_chromeos.cc

Issue 1083683003: Speculative revert by sheriff (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed an unrelated commit that had accidentally slipped in. Created 5 years, 8 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 | « WATCHLISTS ('k') | ash/content/display/screen_orientation_controller_chromeos_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/content/display/screen_orientation_controller_chromeos.cc
diff --git a/ash/content/display/screen_orientation_controller_chromeos.cc b/ash/content/display/screen_orientation_controller_chromeos.cc
index dbd44652a2e6b39e6463ddcf4ada549c79e477db..07659d7c131d282c85a13f8f4a985b153b72b28b 100644
--- a/ash/content/display/screen_orientation_controller_chromeos.cc
+++ b/ash/content/display/screen_orientation_controller_chromeos.cc
@@ -196,11 +196,10 @@ void ScreenOrientationController::Unlock(content::WebContents* web_contents) {
void ScreenOrientationController::OnDisplayConfigurationChanged() {
if (ignore_display_configuration_updates_)
return;
- DisplayManager* display_manager = Shell::GetInstance()->display_manager();
- if (!display_manager->HasInternalDisplay())
- return;
gfx::Display::Rotation user_rotation =
- display_manager->GetDisplayInfo(gfx::Display::InternalDisplayId())
+ Shell::GetInstance()
+ ->display_manager()
+ ->GetDisplayInfo(gfx::Display::InternalDisplayId())
.rotation();
if (user_rotation != current_rotation_) {
// A user may change other display configuration settings. When the user
@@ -213,14 +212,11 @@ void ScreenOrientationController::OnDisplayConfigurationChanged() {
void ScreenOrientationController::OnMaximizeModeStarted() {
DisplayManager* display_manager = Shell::GetInstance()->display_manager();
- // Do not exit early, as the internal display can be determined after Maximize
- // Mode has started. (chrome-os-partner:38796)
- // Always start observing.
- if (display_manager->HasInternalDisplay()) {
- current_rotation_ = user_rotation_ =
- display_manager->GetDisplayInfo(gfx::Display::InternalDisplayId())
- .rotation();
- }
+ if (!display_manager->HasInternalDisplay())
+ return;
+ current_rotation_ = user_rotation_ =
+ display_manager->GetDisplayInfo(gfx::Display::InternalDisplayId())
+ .rotation();
if (!rotation_locked_)
LoadDisplayRotationProperties();
chromeos::AccelerometerReader::GetInstance()->AddObserver(this);
@@ -228,6 +224,8 @@ void ScreenOrientationController::OnMaximizeModeStarted() {
}
void ScreenOrientationController::OnMaximizeModeEnded() {
+ if (!Shell::GetInstance()->display_manager()->HasInternalDisplay())
+ return;
chromeos::AccelerometerReader::GetInstance()->RemoveObserver(this);
Shell::GetInstance()->display_controller()->RemoveObserver(this);
if (current_rotation_ != user_rotation_)
« no previous file with comments | « WATCHLISTS ('k') | ash/content/display/screen_orientation_controller_chromeos_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698