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

Side by Side Diff: ash/display/display_manager.cc

Issue 620673002: Flip the left/right speaker when the device is in yoga mode. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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/audio/tray_audio.cc » ('j') | ash/system/audio/tray_audio_delegate.h » ('J')
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/display/display_manager.h" 5 #include "ash/display/display_manager.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <cmath> 8 #include <cmath>
9 #include <set> 9 #include <set>
10 #include <string> 10 #include <string>
(...skipping 21 matching lines...) Expand all
32 #include "ui/gfx/screen.h" 32 #include "ui/gfx/screen.h"
33 #include "ui/gfx/size_conversions.h" 33 #include "ui/gfx/size_conversions.h"
34 34
35 #if defined(USE_X11) 35 #if defined(USE_X11)
36 #include "ui/base/x/x11_util.h" 36 #include "ui/base/x/x11_util.h"
37 #endif 37 #endif
38 38
39 #if defined(OS_CHROMEOS) 39 #if defined(OS_CHROMEOS)
40 #include "ash/display/display_configurator_animation.h" 40 #include "ash/display/display_configurator_animation.h"
41 #include "base/sys_info.h" 41 #include "base/sys_info.h"
42 #include "chromeos/audio/cras_audio_handler.h"
42 #endif 43 #endif
43 44
44 #if defined(OS_WIN) 45 #if defined(OS_WIN)
45 #include "base/win/windows_version.h" 46 #include "base/win/windows_version.h"
46 #endif 47 #endif
47 48
48 namespace ash { 49 namespace ash {
49 typedef std::vector<gfx::Display> DisplayList; 50 typedef std::vector<gfx::Display> DisplayList;
50 typedef std::vector<DisplayInfo> DisplayInfoList; 51 typedef std::vector<DisplayInfo> DisplayInfoList;
51 52
(...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after
430 DisplayInfo info = GetDisplayInfo(iter->id()); 431 DisplayInfo info = GetDisplayInfo(iter->id());
431 if (info.id() == display_id) { 432 if (info.id() == display_id) {
432 if (info.rotation() == rotation) 433 if (info.rotation() == rotation)
433 return; 434 return;
434 info.set_rotation(rotation); 435 info.set_rotation(rotation);
435 } 436 }
436 display_info_list.push_back(info); 437 display_info_list.push_back(info);
437 } 438 }
438 AddMirrorDisplayInfoIfAny(&display_info_list); 439 AddMirrorDisplayInfoIfAny(&display_info_list);
439 UpdateDisplays(display_info_list); 440 UpdateDisplays(display_info_list);
441
442 #if defined(OS_CHROMEOS)
443 // Swap the left/right channel of the speaker only if it is yoga mode.
oshima 2014/09/30 22:29:53 1) Can you use gfx::DisplayObserver::OnDisplayMetr
jennyz 2014/10/01 00:22:59 Thanks for pointing me to gfx::DisplayObserver::On
444 chromeos::CrasAudioHandler::Get()->SwapLeftRight(rotation ==
445 gfx::Display::ROTATE_180);
446 #endif
440 } 447 }
441 448
442 void DisplayManager::SetDisplayUIScale(int64 display_id, 449 void DisplayManager::SetDisplayUIScale(int64 display_id,
443 float ui_scale) { 450 float ui_scale) {
444 if (!IsDisplayUIScalingEnabled() || 451 if (!IsDisplayUIScalingEnabled() ||
445 gfx::Display::InternalDisplayId() != display_id) { 452 gfx::Display::InternalDisplayId() != display_id) {
446 return; 453 return;
447 } 454 }
448 455
449 // TODO(mukai): merge this implementation into SetDisplayMode(). 456 // TODO(mukai): merge this implementation into SetDisplayMode().
(...skipping 809 matching lines...) Expand 10 before | Expand all | Expand 10 after
1259 new_secondary_origin.Offset(-secondary_bounds.width(), offset); 1266 new_secondary_origin.Offset(-secondary_bounds.width(), offset);
1260 break; 1267 break;
1261 } 1268 }
1262 gfx::Insets insets = secondary_display->GetWorkAreaInsets(); 1269 gfx::Insets insets = secondary_display->GetWorkAreaInsets();
1263 secondary_display->set_bounds( 1270 secondary_display->set_bounds(
1264 gfx::Rect(new_secondary_origin, secondary_bounds.size())); 1271 gfx::Rect(new_secondary_origin, secondary_bounds.size()));
1265 secondary_display->UpdateWorkAreaFromInsets(insets); 1272 secondary_display->UpdateWorkAreaFromInsets(insets);
1266 } 1273 }
1267 1274
1268 } // namespace ash 1275 } // namespace ash
OLDNEW
« no previous file with comments | « no previous file | ash/system/audio/tray_audio.cc » ('j') | ash/system/audio/tray_audio_delegate.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698