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

Unified Diff: chrome/browser/ui/webui/options/chromeos/display_options_handler.cc

Issue 1071353003: Prevent DisplayPreferences from saving incorrect rotations. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
Index: chrome/browser/ui/webui/options/chromeos/display_options_handler.cc
diff --git a/chrome/browser/ui/webui/options/chromeos/display_options_handler.cc b/chrome/browser/ui/webui/options/chromeos/display_options_handler.cc
index d3547438220913808c40d2e3b7d372cbf29ac64f..84129b89e8e46761ab586f44e0bfeb58cb4c7830 100644
--- a/chrome/browser/ui/webui/options/chromeos/display_options_handler.cc
+++ b/chrome/browser/ui/webui/options/chromeos/display_options_handler.cc
@@ -279,7 +279,8 @@ void DisplayOptionsHandler::SendDisplayInfo(
js_display->SetBoolean("isPrimary", display.id() == primary_id);
js_display->SetBoolean("isInternal", display.IsInternal());
js_display->SetInteger("orientation",
- static_cast<int>(display_info.rotation()));
+ static_cast<int>(display_info.Rotation(
+ gfx::Display::ROTATION_SOURCE_ACTIVE)));
base::ListValue* js_resolutions = new base::ListValue();
for (const ash::DisplayMode& display_mode : display_info.display_modes()) {
@@ -438,7 +439,8 @@ void DisplayOptionsHandler::HandleSetOrientation(const base::ListValue* args) {
content::RecordAction(
base::UserMetricsAction("Options_DisplaySetOrientation"));
- ash::ScreenRotationAnimator(display_id).Rotate(new_rotation);
+ ash::ScreenRotationAnimator(display_id)
+ .Rotate(new_rotation, gfx::Display::ROTATION_SOURCE_USER);
}
void DisplayOptionsHandler::HandleSetColorProfile(const base::ListValue* args) {

Powered by Google App Engine
This is Rietveld 408576698