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 <set> | 7 #include <set> |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
434 } | 434 } |
435 } | 435 } |
436 #endif | 436 #endif |
437 return primary_candidate; | 437 return primary_candidate; |
438 } | 438 } |
439 | 439 |
440 size_t DisplayManager::GetNumDisplays() const { | 440 size_t DisplayManager::GetNumDisplays() const { |
441 return displays_.size(); | 441 return displays_.size(); |
442 } | 442 } |
443 | 443 |
| 444 bool DisplayManager::IsMirrored() const { |
| 445 return mirrored_display_id_ != gfx::Display::kInvalidDisplayID; |
| 446 } |
| 447 |
444 const gfx::Display& DisplayManager::GetDisplayNearestWindow( | 448 const gfx::Display& DisplayManager::GetDisplayNearestWindow( |
445 const Window* window) const { | 449 const Window* window) const { |
446 if (!window) | 450 if (!window) |
447 return DisplayController::GetPrimaryDisplay(); | 451 return DisplayController::GetPrimaryDisplay(); |
448 const RootWindow* root = window->GetRootWindow(); | 452 const RootWindow* root = window->GetRootWindow(); |
449 DisplayManager* manager = const_cast<DisplayManager*>(this); | 453 DisplayManager* manager = const_cast<DisplayManager*>(this); |
450 return root ? | 454 return root ? |
451 manager->FindDisplayForRootWindow(root) : | 455 manager->FindDisplayForRootWindow(root) : |
452 DisplayController::GetPrimaryDisplay(); | 456 DisplayController::GetPrimaryDisplay(); |
453 } | 457 } |
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
663 // always (0,0) and the secondary display's bounds will be updated | 667 // always (0,0) and the secondary display's bounds will be updated |
664 // by |DisplayController::UpdateDisplayBoundsForLayout|. | 668 // by |DisplayController::UpdateDisplayBoundsForLayout|. |
665 new_display.SetScaleAndBounds( | 669 new_display.SetScaleAndBounds( |
666 display_info.device_scale_factor(), gfx::Rect(bounds_in_pixel.size())); | 670 display_info.device_scale_factor(), gfx::Rect(bounds_in_pixel.size())); |
667 new_display.set_rotation(display_info.rotation()); | 671 new_display.set_rotation(display_info.rotation()); |
668 return new_display; | 672 return new_display; |
669 } | 673 } |
670 | 674 |
671 } // namespace internal | 675 } // namespace internal |
672 } // namespace ash | 676 } // namespace ash |
OLD | NEW |