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 #ifndef UI_MOJO_INIT_SCREEN_MOJO_H_ | 5 #ifndef UI_MOJO_INIT_SCREEN_MOJO_H_ |
6 #define UI_MOJO_INIT_SCREEN_MOJO_H_ | 6 #define UI_MOJO_INIT_SCREEN_MOJO_H_ |
7 | 7 |
| 8 #include <vector> |
| 9 |
8 #include "ui/gfx/display.h" | 10 #include "ui/gfx/display.h" |
9 #include "ui/gfx/geometry/size.h" | |
10 #include "ui/gfx/screen.h" | 11 #include "ui/gfx/screen.h" |
11 | 12 |
12 namespace ui { | 13 namespace ui { |
13 namespace mojo { | 14 namespace mojo { |
14 | 15 |
15 class ScreenMojo : public gfx::Screen { | 16 class ScreenMojo : public gfx::Screen { |
16 public: | 17 public: |
17 ScreenMojo(const gfx::Size& screen_size_in_pixels, float device_pixel_ratio); | 18 explicit ScreenMojo(const std::vector<gfx::Display>& displays); |
| 19 ~ScreenMojo() override; |
18 | 20 |
19 // gfx::Screen: | 21 // gfx::Screen: |
20 gfx::Point GetCursorScreenPoint() override; | 22 gfx::Point GetCursorScreenPoint() override; |
21 gfx::NativeWindow GetWindowUnderCursor() override; | 23 gfx::NativeWindow GetWindowUnderCursor() override; |
22 gfx::NativeWindow GetWindowAtScreenPoint(const gfx::Point& point) override; | 24 gfx::NativeWindow GetWindowAtScreenPoint(const gfx::Point& point) override; |
23 gfx::Display GetPrimaryDisplay() const override; | 25 gfx::Display GetPrimaryDisplay() const override; |
24 gfx::Display GetDisplayNearestWindow(gfx::NativeView view) const override; | 26 gfx::Display GetDisplayNearestWindow(gfx::NativeView view) const override; |
25 gfx::Display GetDisplayNearestPoint(const gfx::Point& point) const override; | 27 gfx::Display GetDisplayNearestPoint(const gfx::Point& point) const override; |
26 int GetNumDisplays() const override; | 28 int GetNumDisplays() const override; |
27 std::vector<gfx::Display> GetAllDisplays() const override; | 29 std::vector<gfx::Display> GetAllDisplays() const override; |
28 gfx::Display GetDisplayMatching(const gfx::Rect& match_rect) const override; | 30 gfx::Display GetDisplayMatching(const gfx::Rect& match_rect) const override; |
29 void AddObserver(gfx::DisplayObserver* observer) override; | 31 void AddObserver(gfx::DisplayObserver* observer) override; |
30 void RemoveObserver(gfx::DisplayObserver* observer) override; | 32 void RemoveObserver(gfx::DisplayObserver* observer) override; |
31 | 33 |
32 private: | 34 private: |
33 const gfx::Size screen_size_in_pixels_; | 35 const std::vector<gfx::Display> displays_; |
34 const float device_pixel_ratio_; | |
35 | |
36 gfx::Display display_; | |
37 | 36 |
38 DISALLOW_COPY_AND_ASSIGN(ScreenMojo); | 37 DISALLOW_COPY_AND_ASSIGN(ScreenMojo); |
39 }; | 38 }; |
40 | 39 |
41 } // namespace mojo | 40 } // namespace mojo |
42 } // namespace ui | 41 } // namespace ui |
43 | 42 |
44 #endif // UI_MOJO_INIT_SCREEN_MOJO_H_ | 43 #endif // UI_MOJO_INIT_SCREEN_MOJO_H_ |
OLD | NEW |