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_controller.h" | 5 #include "ash/display/display_controller.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <cmath> | 8 #include <cmath> |
9 #include <map> | 9 #include <map> |
10 | 10 |
(...skipping 20 matching lines...) Expand all Loading... |
31 #include "ui/aura/root_window_transformer.h" | 31 #include "ui/aura/root_window_transformer.h" |
32 #include "ui/aura/window.h" | 32 #include "ui/aura/window.h" |
33 #include "ui/aura/window_property.h" | 33 #include "ui/aura/window_property.h" |
34 #include "ui/aura/window_tracker.h" | 34 #include "ui/aura/window_tracker.h" |
35 #include "ui/compositor/compositor.h" | 35 #include "ui/compositor/compositor.h" |
36 #include "ui/compositor/dip_util.h" | 36 #include "ui/compositor/dip_util.h" |
37 #include "ui/gfx/display.h" | 37 #include "ui/gfx/display.h" |
38 #include "ui/gfx/screen.h" | 38 #include "ui/gfx/screen.h" |
39 | 39 |
40 #if defined(OS_CHROMEOS) | 40 #if defined(OS_CHROMEOS) |
41 #include "base/chromeos/chromeos_version.h" | 41 #include "base/sys_info.h" |
42 #include "base/time/time.h" | 42 #include "base/time/time.h" |
43 #if defined(USE_X11) | 43 #if defined(USE_X11) |
44 #include "ash/display/output_configurator_animation.h" | 44 #include "ash/display/output_configurator_animation.h" |
45 #include "chromeos/display/output_configurator.h" | 45 #include "chromeos/display/output_configurator.h" |
46 #include "ui/base/x/x11_util.h" | 46 #include "ui/base/x/x11_util.h" |
47 #include "ui/gfx/x/x11_types.h" | 47 #include "ui/gfx/x/x11_types.h" |
48 | 48 |
49 // Including this at the bottom to avoid other | 49 // Including this at the bottom to avoid other |
50 // potential conflict with chrome headers. | 50 // potential conflict with chrome headers. |
51 #include <X11/extensions/Xrandr.h> | 51 #include <X11/extensions/Xrandr.h> |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
218 //////////////////////////////////////////////////////////////////////////////// | 218 //////////////////////////////////////////////////////////////////////////////// |
219 // DisplayController | 219 // DisplayController |
220 | 220 |
221 DisplayController::DisplayController() | 221 DisplayController::DisplayController() |
222 : primary_root_window_for_replace_(NULL), | 222 : primary_root_window_for_replace_(NULL), |
223 focus_activation_store_(new internal::FocusActivationStore()), | 223 focus_activation_store_(new internal::FocusActivationStore()), |
224 mirror_window_controller_(new internal::MirrorWindowController) { | 224 mirror_window_controller_(new internal::MirrorWindowController) { |
225 #if defined(OS_CHROMEOS) | 225 #if defined(OS_CHROMEOS) |
226 CommandLine* command_line = CommandLine::ForCurrentProcess(); | 226 CommandLine* command_line = CommandLine::ForCurrentProcess(); |
227 if (!command_line->HasSwitch(switches::kAshDisableDisplayChangeLimiter) && | 227 if (!command_line->HasSwitch(switches::kAshDisableDisplayChangeLimiter) && |
228 base::chromeos::IsRunningOnChromeOS()) | 228 base::SysInfo::IsRunningOnChromeOS()) |
229 limiter_.reset(new DisplayChangeLimiter); | 229 limiter_.reset(new DisplayChangeLimiter); |
230 #endif | 230 #endif |
231 // Reset primary display to make sure that tests don't use | 231 // Reset primary display to make sure that tests don't use |
232 // stale display info from previous tests. | 232 // stale display info from previous tests. |
233 primary_display_id = gfx::Display::kInvalidDisplayID; | 233 primary_display_id = gfx::Display::kInvalidDisplayID; |
234 delete primary_display_for_shutdown; | 234 delete primary_display_for_shutdown; |
235 primary_display_for_shutdown = NULL; | 235 primary_display_for_shutdown = NULL; |
236 num_displays_for_shutdown = -1; | 236 num_displays_for_shutdown = -1; |
237 } | 237 } |
238 | 238 |
(...skipping 541 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
780 internal::InitRootWindowSettings(root_window)->display_id = display.id(); | 780 internal::InitRootWindowSettings(root_window)->display_id = display.id(); |
781 root_window->Init(); | 781 root_window->Init(); |
782 | 782 |
783 root_windows_[display.id()] = root_window; | 783 root_windows_[display.id()] = root_window; |
784 SetDisplayPropertiesOnHostWindow(root_window, display); | 784 SetDisplayPropertiesOnHostWindow(root_window, display); |
785 | 785 |
786 #if defined(OS_CHROMEOS) | 786 #if defined(OS_CHROMEOS) |
787 static bool force_constrain_pointer_to_root = | 787 static bool force_constrain_pointer_to_root = |
788 CommandLine::ForCurrentProcess()->HasSwitch( | 788 CommandLine::ForCurrentProcess()->HasSwitch( |
789 switches::kAshConstrainPointerToRoot); | 789 switches::kAshConstrainPointerToRoot); |
790 if (base::chromeos::IsRunningOnChromeOS() || force_constrain_pointer_to_root) | 790 if (base::SysInfo::IsRunningOnChromeOS() || force_constrain_pointer_to_root) |
791 root_window->ConfineCursorToWindow(); | 791 root_window->ConfineCursorToWindow(); |
792 #endif | 792 #endif |
793 return root_window; | 793 return root_window; |
794 } | 794 } |
795 | 795 |
796 void DisplayController::UpdateDisplayBoundsForLayout() { | 796 void DisplayController::UpdateDisplayBoundsForLayout() { |
797 internal::DisplayManager* display_manager = GetDisplayManager(); | 797 internal::DisplayManager* display_manager = GetDisplayManager(); |
798 if (Shell::GetScreen()->GetNumDisplays() < 2 || | 798 if (Shell::GetScreen()->GetNumDisplays() < 2 || |
799 display_manager->num_connected_displays() < 2) { | 799 display_manager->num_connected_displays() < 2) { |
800 return; | 800 return; |
(...skipping 23 matching lines...) Expand all Loading... |
824 for (size_t i = 0; i < root_windows.size(); ++i) { | 824 for (size_t i = 0; i < root_windows.size(); ++i) { |
825 std::string name = | 825 std::string name = |
826 root_windows[i] == primary ? "aura_root_0" : "aura_root_x"; | 826 root_windows[i] == primary ? "aura_root_0" : "aura_root_x"; |
827 gfx::AcceleratedWidget xwindow = root_windows[i]->GetAcceleratedWidget(); | 827 gfx::AcceleratedWidget xwindow = root_windows[i]->GetAcceleratedWidget(); |
828 XStoreName(gfx::GetXDisplay(), xwindow, name.c_str()); | 828 XStoreName(gfx::GetXDisplay(), xwindow, name.c_str()); |
829 } | 829 } |
830 #endif | 830 #endif |
831 } | 831 } |
832 | 832 |
833 } // namespace ash | 833 } // namespace ash |
OLD | NEW |