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

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: Rebase 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 | « chrome/browser/extensions/display_info_provider_chromeos_unittest.cc ('k') | ui/gfx/display.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 ca4cc50c06a734f0552dd017ff069dd3543ca2df..c451e04b4e50a36242bae58300dea52e4b1527db 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,7 @@ 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.GetActiveRotation()));
base::ListValue* js_resolutions = new base::ListValue();
for (const ash::DisplayMode& display_mode : display_info.display_modes()) {
@@ -438,7 +438,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) {
« no previous file with comments | « chrome/browser/extensions/display_info_provider_chromeos_unittest.cc ('k') | ui/gfx/display.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698