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

Side by Side 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, 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 253 matching lines...) Expand 10 before | Expand all | Expand 10 after
264 return false; 264 return false;
265 } 265 }
266 266
267 if (iter.second.configured_ui_scale() != 267 if (iter.second.configured_ui_scale() !=
268 old_iter->second.configured_ui_scale()) { 268 old_iter->second.configured_ui_scale()) {
269 *out_additional_message = l10n_util::GetStringFUTF16( 269 *out_additional_message = l10n_util::GetStringFUTF16(
270 IDS_ASH_STATUS_TRAY_DISPLAY_RESOLUTION_CHANGED, 270 IDS_ASH_STATUS_TRAY_DISPLAY_RESOLUTION_CHANGED,
271 GetDisplayName(iter.first), GetDisplaySize(iter.first)); 271 GetDisplayName(iter.first), GetDisplaySize(iter.first));
272 return true; 272 return true;
273 } 273 }
274 if (iter.second.GetActiveRotation() != 274 // We don't show rotation change notification when the rotation source is
275 old_iter->second.GetActiveRotation()) { 275 // the accelerometer.
276 if (iter.second.active_rotation_source() !=
277 display::Display::ROTATION_SOURCE_ACCELEROMETER &&
278 iter.second.GetActiveRotation() !=
279 old_iter->second.GetActiveRotation()) {
276 int rotation_text_id = 0; 280 int rotation_text_id = 0;
277 switch (iter.second.GetActiveRotation()) { 281 switch (iter.second.GetActiveRotation()) {
278 case display::Display::ROTATE_0: 282 case display::Display::ROTATE_0:
279 rotation_text_id = IDS_ASH_STATUS_TRAY_DISPLAY_STANDARD_ORIENTATION; 283 rotation_text_id = IDS_ASH_STATUS_TRAY_DISPLAY_STANDARD_ORIENTATION;
280 break; 284 break;
281 case display::Display::ROTATE_90: 285 case display::Display::ROTATE_90:
282 rotation_text_id = IDS_ASH_STATUS_TRAY_DISPLAY_ORIENTATION_90; 286 rotation_text_id = IDS_ASH_STATUS_TRAY_DISPLAY_ORIENTATION_90;
283 break; 287 break;
284 case display::Display::ROTATE_180: 288 case display::Display::ROTATE_180:
285 rotation_text_id = IDS_ASH_STATUS_TRAY_DISPLAY_ORIENTATION_180; 289 rotation_text_id = IDS_ASH_STATUS_TRAY_DISPLAY_ORIENTATION_180;
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
390 return true; 394 return true;
391 395
392 default: 396 default:
393 // Mirror mode was turned off; other messages should be shown e.g. 397 // Mirror mode was turned off; other messages should be shown e.g.
394 // extended mode is on, ... etc. 398 // extended mode is on, ... etc.
395 return false; 399 return false;
396 } 400 }
397 } 401 }
398 402
399 } // namespace ash 403 } // 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