OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "headless/lib/browser/headless_screen.h" | 5 #include "headless/lib/browser/headless_screen.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "ui/aura/env.h" | 10 #include "ui/aura/env.h" |
(...skipping 19 matching lines...) Expand all Loading... |
30 bool HeadlessScreen::IsWindowUnderCursor(gfx::NativeWindow window) { | 30 bool HeadlessScreen::IsWindowUnderCursor(gfx::NativeWindow window) { |
31 return GetWindowAtScreenPoint(GetCursorScreenPoint()) == window; | 31 return GetWindowAtScreenPoint(GetCursorScreenPoint()) == window; |
32 } | 32 } |
33 | 33 |
34 gfx::NativeWindow HeadlessScreen::GetWindowAtScreenPoint( | 34 gfx::NativeWindow HeadlessScreen::GetWindowAtScreenPoint( |
35 const gfx::Point& point) { | 35 const gfx::Point& point) { |
36 return nullptr; | 36 return nullptr; |
37 } | 37 } |
38 | 38 |
39 display::Display HeadlessScreen::GetDisplayNearestWindow( | 39 display::Display HeadlessScreen::GetDisplayNearestWindow( |
40 gfx::NativeView window) const { | 40 gfx::NativeWindow window) const { |
41 return GetPrimaryDisplay(); | 41 return GetPrimaryDisplay(); |
42 } | 42 } |
43 | 43 |
44 HeadlessScreen::HeadlessScreen(const gfx::Rect& screen_bounds) { | 44 HeadlessScreen::HeadlessScreen(const gfx::Rect& screen_bounds) { |
45 static int64_t synthesized_display_id = 2000; | 45 static int64_t synthesized_display_id = 2000; |
46 display::Display display(synthesized_display_id++); | 46 display::Display display(synthesized_display_id++); |
47 display.SetScaleAndBounds(1.0f, screen_bounds); | 47 display.SetScaleAndBounds(1.0f, screen_bounds); |
48 ProcessDisplayChanged(display, true /* is_primary */); | 48 ProcessDisplayChanged(display, true /* is_primary */); |
49 } | 49 } |
50 | 50 |
51 } // namespace headless | 51 } // namespace headless |
OLD | NEW |