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 728 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
739 // outlives the host. | 739 // outlives the host. |
740 host->AddObserver(this); | 740 host->AddObserver(this); |
741 InitRootWindowSettings(host->window())->display_id = display.id(); | 741 InitRootWindowSettings(host->window())->display_id = display.id(); |
742 host->InitHost(); | 742 host->InitHost(); |
743 | 743 |
744 window_tree_hosts_[display.id()] = ash_host; | 744 window_tree_hosts_[display.id()] = ash_host; |
745 SetDisplayPropertiesOnHost(ash_host, display); | 745 SetDisplayPropertiesOnHost(ash_host, display); |
746 | 746 |
747 #if defined(OS_CHROMEOS) | 747 #if defined(OS_CHROMEOS) |
748 static bool force_constrain_pointer_to_root = | 748 static bool force_constrain_pointer_to_root = |
749 CommandLine::ForCurrentProcess()->HasSwitch( | 749 base::CommandLine::ForCurrentProcess()->HasSwitch( |
750 switches::kAshConstrainPointerToRoot); | 750 switches::kAshConstrainPointerToRoot); |
751 if (base::SysInfo::IsRunningOnChromeOS() || force_constrain_pointer_to_root) | 751 if (base::SysInfo::IsRunningOnChromeOS() || force_constrain_pointer_to_root) |
752 ash_host->ConfineCursorToRootWindow(); | 752 ash_host->ConfineCursorToRootWindow(); |
753 #endif | 753 #endif |
754 return ash_host; | 754 return ash_host; |
755 } | 755 } |
756 | 756 |
757 void DisplayController::OnFadeOutForSwapDisplayFinished() { | 757 void DisplayController::OnFadeOutForSwapDisplayFinished() { |
758 #if defined(OS_CHROMEOS) | 758 #if defined(OS_CHROMEOS) |
759 SetPrimaryDisplay(ScreenUtil::GetSecondaryDisplay()); | 759 SetPrimaryDisplay(ScreenUtil::GetSecondaryDisplay()); |
(...skipping 17 matching lines...) Expand all Loading... |
777 std::string name = | 777 std::string name = |
778 root_windows[i] == primary ? "aura_root_0" : "aura_root_x"; | 778 root_windows[i] == primary ? "aura_root_0" : "aura_root_x"; |
779 gfx::AcceleratedWidget xwindow = | 779 gfx::AcceleratedWidget xwindow = |
780 root_windows[i]->GetHost()->GetAcceleratedWidget(); | 780 root_windows[i]->GetHost()->GetAcceleratedWidget(); |
781 XStoreName(gfx::GetXDisplay(), xwindow, name.c_str()); | 781 XStoreName(gfx::GetXDisplay(), xwindow, name.c_str()); |
782 } | 782 } |
783 #endif | 783 #endif |
784 } | 784 } |
785 | 785 |
786 } // namespace ash | 786 } // namespace ash |
OLD | NEW |