| 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 #ifndef UI_VIEWS_MUS_SCREEN_MUS_H_ | 5 #ifndef UI_VIEWS_MUS_SCREEN_MUS_H_ |
| 6 #define UI_VIEWS_MUS_SCREEN_MUS_H_ | 6 #define UI_VIEWS_MUS_SCREEN_MUS_H_ |
| 7 | 7 |
| 8 #include "mojo/public/cpp/bindings/binding.h" | 8 #include "mojo/public/cpp/bindings/binding.h" |
| 9 #include "services/ui/public/interfaces/display_manager.mojom.h" | 9 #include "services/ui/public/interfaces/display_manager.mojom.h" |
| 10 #include "ui/display/screen_base.h" | 10 #include "ui/display/screen_base.h" |
| 11 #include "ui/views/mus/mus_export.h" | 11 #include "ui/views/mus/mus_export.h" |
| 12 | 12 |
| 13 namespace service_manager { | 13 namespace service_manager { |
| 14 class Connector; | 14 class Connector; |
| 15 } | 15 } |
| 16 | 16 |
| 17 namespace views { | 17 namespace views { |
| 18 | 18 |
| 19 class ScreenMusDelegate; | 19 class ScreenMusDelegate; |
| 20 | 20 |
| 21 // Screen implementation backed by ui::mojom::DisplayManager. | 21 // Screen implementation backed by ui::mojom::DisplayManager. |
| 22 class VIEWS_MUS_EXPORT ScreenMus | 22 class VIEWS_MUS_EXPORT ScreenMus |
| 23 : public display::ScreenBase, | 23 : public display::ScreenBase, |
| 24 public NON_EXPORTED_BASE(ui::mojom::DisplayManagerObserver) { | 24 public NON_EXPORTED_BASE(ui::mojom::DisplayManagerObserver) { |
| 25 public: | 25 public: |
| 26 // |delegate| can be nullptr. | |
| 27 explicit ScreenMus(ScreenMusDelegate* delegate); | 26 explicit ScreenMus(ScreenMusDelegate* delegate); |
| 28 ~ScreenMus() override; | 27 ~ScreenMus() override; |
| 29 | 28 |
| 30 void Init(service_manager::Connector* connector); | 29 void Init(service_manager::Connector* connector); |
| 31 | 30 |
| 32 private: | 31 private: |
| 33 // display::Screen: | 32 // display::Screen: |
| 34 gfx::Point GetCursorScreenPoint() override; | 33 gfx::Point GetCursorScreenPoint() override; |
| 35 bool IsWindowUnderCursor(gfx::NativeWindow window) override; | 34 bool IsWindowUnderCursor(gfx::NativeWindow window) override; |
| 36 aura::Window* GetWindowAtScreenPoint(const gfx::Point& point) override; | 35 aura::Window* GetWindowAtScreenPoint(const gfx::Point& point) override; |
| 37 | 36 |
| 38 // ui::mojom::DisplayManager: | 37 // ui::mojom::DisplayManager: |
| 39 void OnDisplays(std::vector<ui::mojom::WsDisplayPtr> ws_displays, | 38 void OnDisplays(std::vector<ui::mojom::WsDisplayPtr> ws_displays, |
| 40 int64_t primary_display_id, | 39 int64_t primary_display_id, |
| 41 int64_t internal_display_id) override; | 40 int64_t internal_display_id) override; |
| 42 void OnDisplaysChanged( | 41 void OnDisplaysChanged( |
| 43 std::vector<ui::mojom::WsDisplayPtr> ws_displays) override; | 42 std::vector<ui::mojom::WsDisplayPtr> ws_displays) override; |
| 44 void OnDisplayRemoved(int64_t display_id) override; | 43 void OnDisplayRemoved(int64_t display_id) override; |
| 45 void OnPrimaryDisplayChanged(int64_t primary_display_id) override; | 44 void OnPrimaryDisplayChanged(int64_t primary_display_id) override; |
| 46 | 45 |
| 47 ScreenMusDelegate* delegate_; // Can be nullptr. | 46 ScreenMusDelegate* delegate_; |
| 48 ui::mojom::DisplayManagerPtr display_manager_; | 47 ui::mojom::DisplayManagerPtr display_manager_; |
| 49 mojo::Binding<ui::mojom::DisplayManagerObserver> | 48 mojo::Binding<ui::mojom::DisplayManagerObserver> |
| 50 display_manager_observer_binding_; | 49 display_manager_observer_binding_; |
| 51 | 50 |
| 52 DISALLOW_COPY_AND_ASSIGN(ScreenMus); | 51 DISALLOW_COPY_AND_ASSIGN(ScreenMus); |
| 53 }; | 52 }; |
| 54 | 53 |
| 55 } // namespace views | 54 } // namespace views |
| 56 | 55 |
| 57 #endif // UI_VIEWS_MUS_SCREEN_MUS_H_ | 56 #endif // UI_VIEWS_MUS_SCREEN_MUS_H_ |
| OLD | NEW |