OLD | NEW |
| (Empty) |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #include "blimp/engine/app/ui/blimp_screen.h" | |
6 | |
7 #include "ui/aura/window.h" | |
8 #include "ui/aura/window_tree_host.h" | |
9 #include "ui/display/display_observer.h" | |
10 #include "ui/gfx/geometry/size.h" | |
11 | |
12 namespace blimp { | |
13 namespace engine { | |
14 | |
15 namespace { | |
16 | |
17 const int64_t kDisplayId = 1; | |
18 | |
19 } // namespace | |
20 | |
21 BlimpScreen::BlimpScreen() { | |
22 display::Display display(kDisplayId); | |
23 ProcessDisplayChanged(display, true /* is_primary */); | |
24 } | |
25 | |
26 BlimpScreen::~BlimpScreen() {} | |
27 | |
28 void BlimpScreen::UpdateDisplayScaleAndSize(float scale, | |
29 const gfx::Size& size) { | |
30 display::Display display(GetPrimaryDisplay()); | |
31 if (scale == display.device_scale_factor() && | |
32 size == display.GetSizeInPixel()) { | |
33 return; | |
34 } | |
35 | |
36 display.SetScaleAndBounds(scale, gfx::Rect(size)); | |
37 display_list().UpdateDisplay(display); | |
38 } | |
39 | |
40 gfx::Point BlimpScreen::GetCursorScreenPoint() { | |
41 return gfx::Point(); | |
42 } | |
43 | |
44 bool BlimpScreen::IsWindowUnderCursor(gfx::NativeWindow window) { | |
45 NOTIMPLEMENTED(); | |
46 return false; | |
47 } | |
48 | |
49 gfx::NativeWindow BlimpScreen::GetWindowAtScreenPoint(const gfx::Point& point) { | |
50 return window_tree_host_ | |
51 ? window_tree_host_->window()->GetTopWindowContainingPoint(point) | |
52 : gfx::NativeWindow(nullptr); | |
53 } | |
54 | |
55 display::Display BlimpScreen::GetDisplayNearestWindow( | |
56 gfx::NativeWindow window) const { | |
57 return GetPrimaryDisplay(); | |
58 } | |
59 | |
60 } // namespace engine | |
61 } // namespace blimp | |
OLD | NEW |