| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "blimp/engine/app/ui/blimp_screen.h" | 5 #include "blimp/engine/app/ui/blimp_screen.h" |
| 6 | 6 |
| 7 #include "ui/aura/window.h" | 7 #include "ui/aura/window.h" |
| 8 #include "ui/aura/window_tree_host.h" | 8 #include "ui/aura/window_tree_host.h" |
| 9 #include "ui/display/display_observer.h" | 9 #include "ui/display/display_observer.h" |
| 10 #include "ui/gfx/geometry/size.h" | 10 #include "ui/gfx/geometry/size.h" |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 } | 59 } |
| 60 | 60 |
| 61 int BlimpScreen::GetNumDisplays() const { | 61 int BlimpScreen::GetNumDisplays() const { |
| 62 return kNumDisplays; | 62 return kNumDisplays; |
| 63 } | 63 } |
| 64 | 64 |
| 65 std::vector<display::Display> BlimpScreen::GetAllDisplays() const { | 65 std::vector<display::Display> BlimpScreen::GetAllDisplays() const { |
| 66 return std::vector<display::Display>(1, display_); | 66 return std::vector<display::Display>(1, display_); |
| 67 } | 67 } |
| 68 | 68 |
| 69 bool BlimpScreen::GetDisplayWithDisplayId(int64_t display_id, |
| 70 display::Display* display) const { |
| 71 if (display_.id() == display_id) { |
| 72 *display = display_; |
| 73 return true; |
| 74 } |
| 75 return false; |
| 76 } |
| 77 |
| 69 display::Display BlimpScreen::GetDisplayNearestWindow( | 78 display::Display BlimpScreen::GetDisplayNearestWindow( |
| 70 gfx::NativeWindow window) const { | 79 gfx::NativeWindow window) const { |
| 71 return display_; | 80 return display_; |
| 72 } | 81 } |
| 73 | 82 |
| 74 display::Display BlimpScreen::GetDisplayNearestPoint( | 83 display::Display BlimpScreen::GetDisplayNearestPoint( |
| 75 const gfx::Point& point) const { | 84 const gfx::Point& point) const { |
| 76 return display_; | 85 return display_; |
| 77 } | 86 } |
| 78 | 87 |
| 79 display::Display BlimpScreen::GetDisplayMatching( | 88 display::Display BlimpScreen::GetDisplayMatching( |
| 80 const gfx::Rect& match_rect) const { | 89 const gfx::Rect& match_rect) const { |
| 81 return display_; | 90 return display_; |
| 82 } | 91 } |
| 83 | 92 |
| 84 display::Display BlimpScreen::GetPrimaryDisplay() const { | 93 display::Display BlimpScreen::GetPrimaryDisplay() const { |
| 85 return display_; | 94 return display_; |
| 86 } | 95 } |
| 87 | 96 |
| 88 void BlimpScreen::AddObserver(display::DisplayObserver* observer) { | 97 void BlimpScreen::AddObserver(display::DisplayObserver* observer) { |
| 89 observers_.AddObserver(observer); | 98 observers_.AddObserver(observer); |
| 90 } | 99 } |
| 91 | 100 |
| 92 void BlimpScreen::RemoveObserver(display::DisplayObserver* observer) { | 101 void BlimpScreen::RemoveObserver(display::DisplayObserver* observer) { |
| 93 observers_.RemoveObserver(observer); | 102 observers_.RemoveObserver(observer); |
| 94 } | 103 } |
| 95 | 104 |
| 96 } // namespace engine | 105 } // namespace engine |
| 97 } // namespace blimp | 106 } // namespace blimp |
| OLD | NEW |