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

Unified Diff: ash/system/screen_layout_observer.cc

Issue 2853113005: Avoid Showing rotation change notification when source is accelerometer (Closed)
Patch Set: Don't run on mushrome Created 3 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 | « no previous file | ash/system/screen_layout_observer_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/system/screen_layout_observer.cc
diff --git a/ash/system/screen_layout_observer.cc b/ash/system/screen_layout_observer.cc
index 0ead7c5d1b20805b7b904000800e70833047c2b4..0056693d5a9f7f7988d3c985e5e548ea39ae2c03 100644
--- a/ash/system/screen_layout_observer.cc
+++ b/ash/system/screen_layout_observer.cc
@@ -271,8 +271,12 @@ bool ScreenLayoutObserver::GetDisplayMessageForNotification(
GetDisplayName(iter.first), GetDisplaySize(iter.first));
return true;
}
- if (iter.second.GetActiveRotation() !=
- old_iter->second.GetActiveRotation()) {
+ // We don't show rotation change notification when the rotation source is
+ // the accelerometer.
+ if (iter.second.active_rotation_source() !=
+ display::Display::ROTATION_SOURCE_ACCELEROMETER &&
+ iter.second.GetActiveRotation() !=
+ old_iter->second.GetActiveRotation()) {
int rotation_text_id = 0;
switch (iter.second.GetActiveRotation()) {
case display::Display::ROTATE_0:
« no previous file with comments | « no previous file | ash/system/screen_layout_observer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698