Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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 Loading... | |
| 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 Loading... | |
| 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 |
| OLD | NEW |