| 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 BLIMP_ENGINE_APP_UI_BLIMP_SCREEN_H_ | 5 #ifndef BLIMP_ENGINE_APP_UI_BLIMP_SCREEN_H_ |
| 6 #define BLIMP_ENGINE_APP_UI_BLIMP_SCREEN_H_ | 6 #define BLIMP_ENGINE_APP_UI_BLIMP_SCREEN_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| 11 #include "base/observer_list.h" | 11 #include "base/observer_list.h" |
| 12 #include "ui/gfx/display.h" | 12 #include "ui/display/display.h" |
| 13 #include "ui/gfx/screen.h" | 13 #include "ui/display/screen.h" |
| 14 | 14 |
| 15 namespace aura { | 15 namespace aura { |
| 16 class WindowTreeHost; | 16 class WindowTreeHost; |
| 17 } | 17 } |
| 18 | 18 |
| 19 namespace blimp { | 19 namespace blimp { |
| 20 namespace engine { | 20 namespace engine { |
| 21 | 21 |
| 22 // Presents the client's single screen. | 22 // Presents the client's single screen. |
| 23 class BlimpScreen : public gfx::Screen { | 23 class BlimpScreen : public display::Screen { |
| 24 public: | 24 public: |
| 25 BlimpScreen(); | 25 BlimpScreen(); |
| 26 ~BlimpScreen() override; | 26 ~BlimpScreen() override; |
| 27 | 27 |
| 28 void set_window_tree_host(aura::WindowTreeHost* window_tree_host) { | 28 void set_window_tree_host(aura::WindowTreeHost* window_tree_host) { |
| 29 window_tree_host_ = window_tree_host; | 29 window_tree_host_ = window_tree_host; |
| 30 } | 30 } |
| 31 | 31 |
| 32 // Updates the size reported by the primary display. | 32 // Updates the size reported by the primary display. |
| 33 void UpdateDisplayScaleAndSize(float scale, const gfx::Size& size); | 33 void UpdateDisplayScaleAndSize(float scale, const gfx::Size& size); |
| 34 | 34 |
| 35 // gfx::Screen implementation. | 35 // display::Screen implementation. |
| 36 gfx::Point GetCursorScreenPoint() override; | 36 gfx::Point GetCursorScreenPoint() override; |
| 37 gfx::NativeWindow GetWindowUnderCursor() override; | 37 gfx::NativeWindow GetWindowUnderCursor() override; |
| 38 gfx::NativeWindow GetWindowAtScreenPoint(const gfx::Point& point) override; | 38 gfx::NativeWindow GetWindowAtScreenPoint(const gfx::Point& point) override; |
| 39 int GetNumDisplays() const override; | 39 int GetNumDisplays() const override; |
| 40 std::vector<gfx::Display> GetAllDisplays() const override; | 40 std::vector<display::Display> GetAllDisplays() const override; |
| 41 gfx::Display GetDisplayNearestWindow(gfx::NativeView view) const override; | 41 display::Display GetDisplayNearestWindow(gfx::NativeView view) const override; |
| 42 gfx::Display GetDisplayNearestPoint(const gfx::Point& point) const override; | 42 display::Display GetDisplayNearestPoint( |
| 43 gfx::Display GetDisplayMatching(const gfx::Rect& match_rect) const override; | 43 const gfx::Point& point) const override; |
| 44 gfx::Display GetPrimaryDisplay() const override; | 44 display::Display GetDisplayMatching( |
| 45 void AddObserver(gfx::DisplayObserver* observer) override; | 45 const gfx::Rect& match_rect) const override; |
| 46 void RemoveObserver(gfx::DisplayObserver* observer) override; | 46 display::Display GetPrimaryDisplay() const override; |
| 47 void AddObserver(display::DisplayObserver* observer) override; |
| 48 void RemoveObserver(display::DisplayObserver* observer) override; |
| 47 | 49 |
| 48 private: | 50 private: |
| 49 aura::WindowTreeHost* window_tree_host_; | 51 aura::WindowTreeHost* window_tree_host_; |
| 50 gfx::Display display_; | 52 display::Display display_; |
| 51 base::ObserverList<gfx::DisplayObserver> observers_; | 53 base::ObserverList<display::DisplayObserver> observers_; |
| 52 DISALLOW_COPY_AND_ASSIGN(BlimpScreen); | 54 DISALLOW_COPY_AND_ASSIGN(BlimpScreen); |
| 53 }; | 55 }; |
| 54 | 56 |
| 55 } // namespace engine | 57 } // namespace engine |
| 56 } // namespace blimp | 58 } // namespace blimp |
| 57 | 59 |
| 58 #endif // BLIMP_ENGINE_APP_UI_BLIMP_SCREEN_H_ | 60 #endif // BLIMP_ENGINE_APP_UI_BLIMP_SCREEN_H_ |
| OLD | NEW |