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

Side by Side Diff: ash/system/screen_layout_observer.cc

Issue 2861953002: [Merge to M59] Avoid Showing rotation change notification when source is accelerometer (Closed)
Patch Set: Created 3 years, 7 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 unified diff | Download patch
« no previous file with comments | « no previous file | ash/system/screen_layout_observer_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ash/system/screen_layout_observer.h" 5 #include "ash/system/screen_layout_observer.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <utility> 8 #include <utility>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after
289 return false; 289 return false;
290 } 290 }
291 291
292 if (iter.second.configured_ui_scale() != 292 if (iter.second.configured_ui_scale() !=
293 old_iter->second.configured_ui_scale()) { 293 old_iter->second.configured_ui_scale()) {
294 *out_additional_message = l10n_util::GetStringFUTF16( 294 *out_additional_message = l10n_util::GetStringFUTF16(
295 IDS_ASH_STATUS_TRAY_DISPLAY_RESOLUTION_CHANGED, 295 IDS_ASH_STATUS_TRAY_DISPLAY_RESOLUTION_CHANGED,
296 GetDisplayName(iter.first), GetDisplaySize(iter.first)); 296 GetDisplayName(iter.first), GetDisplaySize(iter.first));
297 return true; 297 return true;
298 } 298 }
299 if (iter.second.GetActiveRotation() != 299 // We don't show rotation change notification when the rotation source is
300 old_iter->second.GetActiveRotation()) { 300 // the accelerometer.
301 if (iter.second.active_rotation_source() !=
302 display::Display::ROTATION_SOURCE_ACCELEROMETER &&
303 iter.second.GetActiveRotation() !=
304 old_iter->second.GetActiveRotation()) {
301 int rotation_text_id = 0; 305 int rotation_text_id = 0;
302 switch (iter.second.GetActiveRotation()) { 306 switch (iter.second.GetActiveRotation()) {
303 case display::Display::ROTATE_0: 307 case display::Display::ROTATE_0:
304 rotation_text_id = IDS_ASH_STATUS_TRAY_DISPLAY_STANDARD_ORIENTATION; 308 rotation_text_id = IDS_ASH_STATUS_TRAY_DISPLAY_STANDARD_ORIENTATION;
305 break; 309 break;
306 case display::Display::ROTATE_90: 310 case display::Display::ROTATE_90:
307 rotation_text_id = IDS_ASH_STATUS_TRAY_DISPLAY_ORIENTATION_90; 311 rotation_text_id = IDS_ASH_STATUS_TRAY_DISPLAY_ORIENTATION_90;
308 break; 312 break;
309 case display::Display::ROTATE_180: 313 case display::Display::ROTATE_180:
310 rotation_text_id = IDS_ASH_STATUS_TRAY_DISPLAY_ORIENTATION_180; 314 rotation_text_id = IDS_ASH_STATUS_TRAY_DISPLAY_ORIENTATION_180;
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
415 return true; 419 return true;
416 420
417 default: 421 default:
418 // Mirror mode was turned off; other messages should be shown e.g. 422 // Mirror mode was turned off; other messages should be shown e.g.
419 // extended mode is on, ... etc. 423 // extended mode is on, ... etc.
420 return false; 424 return false;
421 } 425 }
422 } 426 }
423 427
424 } // namespace ash 428 } // namespace ash
OLDNEW
« 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