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

Unified Diff: ash/system/chromeos/tray_display.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: ash/system/chromeos/tray_display.cc
diff --git a/ash/system/chromeos/tray_display.cc b/ash/system/chromeos/tray_display.cc
index 10f9ede1839ad6a1aef7153cb9a152114dee3e99..b2b0a6782c65e20614a22708a7eab59d06b482ec 100644
--- a/ash/system/chromeos/tray_display.cc
+++ b/ash/system/chromeos/tray_display.cc
@@ -207,7 +207,8 @@ class DisplayView : public ActionableView {
base::string16 name = GetDisplayName(external_id);
const DisplayInfo& display_info =
display_manager->GetDisplayInfo(external_id);
- if (display_info.rotation() != gfx::Display::ROTATE_0 ||
+ if (display_info.Rotation(gfx::Display::ROTATION_SOURCE_ACTIVE) !=
+ gfx::Display::ROTATE_0 ||
display_info.configured_ui_scale() != 1.0f ||
!display_info.overscan_insets_in_dip().empty()) {
name = l10n_util::GetStringFUTF16(
@@ -263,10 +264,11 @@ class DisplayView : public ActionableView {
bool ShouldShowFirstDisplayInfo() const {
const DisplayInfo& display_info = GetDisplayManager()->GetDisplayInfo(
GetDisplayManager()->first_display_id());
- return display_info.rotation() != gfx::Display::ROTATE_0 ||
- display_info.configured_ui_scale() != 1.0f ||
- !display_info.overscan_insets_in_dip().empty() ||
- display_info.has_overscan();
+ return display_info.Rotation(gfx::Display::ROTATION_SOURCE_ACTIVE) !=
+ gfx::Display::ROTATE_0 ||
+ display_info.configured_ui_scale() != 1.0f ||
+ !display_info.overscan_insets_in_dip().empty() ||
+ display_info.has_overscan();
}
// Overridden from ActionableView.
@@ -340,9 +342,10 @@ bool TrayDisplay::GetDisplayMessageForNotification(
GetDisplaySize(iter->first));
return true;
}
- if (iter->second.rotation() != old_iter->second.rotation()) {
+ if (iter->second.Rotation(gfx::Display::ROTATION_SOURCE_ACTIVE) !=
+ old_iter->second.Rotation(gfx::Display::ROTATION_SOURCE_ACTIVE)) {
int rotation_text_id = 0;
- switch (iter->second.rotation()) {
+ switch (iter->second.Rotation(gfx::Display::ROTATION_SOURCE_ACTIVE)) {
case gfx::Display::ROTATE_0:
rotation_text_id = IDS_ASH_STATUS_TRAY_DISPLAY_STANDARD_ORIENTATION;
break;

Powered by Google App Engine
This is Rietveld 408576698