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 | 8 |
9 #include "ash/ash_switches.h" | 9 #include "ash/ash_switches.h" |
10 #include "ash/display/multi_display_manager.h" | 10 #include "ash/display/multi_display_manager.h" |
(...skipping 473 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
484 static bool force_constrain_pointer_to_root = | 484 static bool force_constrain_pointer_to_root = |
485 CommandLine::ForCurrentProcess()->HasSwitch( | 485 CommandLine::ForCurrentProcess()->HasSwitch( |
486 switches::kAshConstrainPointerToRoot); | 486 switches::kAshConstrainPointerToRoot); |
487 if (base::chromeos::IsRunningOnChromeOS() || force_constrain_pointer_to_root) | 487 if (base::chromeos::IsRunningOnChromeOS() || force_constrain_pointer_to_root) |
488 root->ConfineCursorToWindow(); | 488 root->ConfineCursorToWindow(); |
489 #endif | 489 #endif |
490 return root; | 490 return root; |
491 } | 491 } |
492 | 492 |
493 void DisplayController::UpdateDisplayBoundsForLayout() { | 493 void DisplayController::UpdateDisplayBoundsForLayout() { |
494 if (gfx::Screen::GetNumDisplays() <= 1) | 494 if (Shell::GetScreen()->GetNumDisplays() <= 1) |
495 return; | 495 return; |
496 | 496 |
497 DCHECK_EQ(2, gfx::Screen::GetNumDisplays()); | 497 DCHECK_EQ(2, Shell::GetScreen()->GetNumDisplays()); |
498 const gfx::Rect& primary_bounds = GetPrimaryDisplay().bounds(); | 498 const gfx::Rect& primary_bounds = GetPrimaryDisplay().bounds(); |
499 | 499 |
500 gfx::Display* secondary_display = GetSecondaryDisplay(); | 500 gfx::Display* secondary_display = GetSecondaryDisplay(); |
501 const gfx::Rect& secondary_bounds = secondary_display->bounds(); | 501 const gfx::Rect& secondary_bounds = secondary_display->bounds(); |
502 gfx::Point new_secondary_origin = primary_bounds.origin(); | 502 gfx::Point new_secondary_origin = primary_bounds.origin(); |
503 | 503 |
504 const DisplayLayout& layout = GetLayoutForDisplay(*secondary_display); | 504 const DisplayLayout& layout = GetLayoutForDisplay(*secondary_display); |
505 DisplayLayout::Position position = layout.position; | 505 DisplayLayout::Position position = layout.position; |
506 | 506 |
507 // Ignore the offset in case the secondary display doesn't share edges with | 507 // Ignore the offset in case the secondary display doesn't share edges with |
(...skipping 28 matching lines...) Expand all Loading... |
536 secondary_display->set_bounds( | 536 secondary_display->set_bounds( |
537 gfx::Rect(new_secondary_origin, secondary_bounds.size())); | 537 gfx::Rect(new_secondary_origin, secondary_bounds.size())); |
538 secondary_display->UpdateWorkAreaFromInsets(insets); | 538 secondary_display->UpdateWorkAreaFromInsets(insets); |
539 } | 539 } |
540 | 540 |
541 void DisplayController::NotifyDisplayConfigurationChanging() { | 541 void DisplayController::NotifyDisplayConfigurationChanging() { |
542 FOR_EACH_OBSERVER(Observer, observers_, OnDisplayConfigurationChanging()); | 542 FOR_EACH_OBSERVER(Observer, observers_, OnDisplayConfigurationChanging()); |
543 } | 543 } |
544 | 544 |
545 } // namespace ash | 545 } // namespace ash |
OLD | NEW |