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 <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/observer_list.h" | 10 #include "base/observer_list.h" |
11 #include "base/run_loop.h" | 11 #include "base/run_loop.h" |
12 #include "components/mus/public/interfaces/display.mojom.h" | 12 #include "components/mus/public/interfaces/display.mojom.h" |
13 #include "mojo/public/cpp/bindings/binding.h" | 13 #include "mojo/public/cpp/bindings/binding.h" |
14 #include "ui/gfx/display.h" | 14 #include "ui/gfx/display.h" |
15 #include "ui/gfx/screen.h" | 15 #include "ui/gfx/screen.h" |
16 #include "ui/views/mus/mus_export.h" | 16 #include "ui/views/mus/mus_export.h" |
17 | 17 |
18 namespace mojo { | 18 namespace shell { |
19 class Connector; | 19 class Connector; |
20 } | 20 } |
21 | 21 |
22 namespace views { | 22 namespace views { |
23 | 23 |
24 class ScreenMusDelegate; | 24 class ScreenMusDelegate; |
25 | 25 |
26 // Screen implementation backed by mus::mojom::DisplayManager. | 26 // Screen implementation backed by mus::mojom::DisplayManager. |
27 class VIEWS_MUS_EXPORT ScreenMus | 27 class VIEWS_MUS_EXPORT ScreenMus |
28 : public gfx::Screen, | 28 : public gfx::Screen, |
29 public NON_EXPORTED_BASE(mus::mojom::DisplayManagerObserver) { | 29 public NON_EXPORTED_BASE(mus::mojom::DisplayManagerObserver) { |
30 public: | 30 public: |
31 explicit ScreenMus(ScreenMusDelegate* delegate); | 31 explicit ScreenMus(ScreenMusDelegate* delegate); |
32 ~ScreenMus() override; | 32 ~ScreenMus() override; |
33 | 33 |
34 void Init(mojo::Connector* connector); | 34 void Init(shell::Connector* connector); |
35 | 35 |
36 private: | 36 private: |
37 int FindDisplayIndexById(int64_t id) const; | 37 int FindDisplayIndexById(int64_t id) const; |
38 | 38 |
39 // Invoked when a display changed in some weay, including being added. | 39 // Invoked when a display changed in some weay, including being added. |
40 // If |is_primary| is true, |changed_display| is the primary display. | 40 // If |is_primary| is true, |changed_display| is the primary display. |
41 void ProcessDisplayChanged(const gfx::Display& changed_display, | 41 void ProcessDisplayChanged(const gfx::Display& changed_display, |
42 bool is_primary); | 42 bool is_primary); |
43 | 43 |
44 // gfx::Screen: | 44 // gfx::Screen: |
(...skipping 21 matching lines...) Expand all Loading... |
66 mojo::Binding<mus::mojom::DisplayManagerObserver> | 66 mojo::Binding<mus::mojom::DisplayManagerObserver> |
67 display_manager_observer_binding_; | 67 display_manager_observer_binding_; |
68 base::ObserverList<gfx::DisplayObserver> observers_; | 68 base::ObserverList<gfx::DisplayObserver> observers_; |
69 | 69 |
70 DISALLOW_COPY_AND_ASSIGN(ScreenMus); | 70 DISALLOW_COPY_AND_ASSIGN(ScreenMus); |
71 }; | 71 }; |
72 | 72 |
73 } // namespace views | 73 } // namespace views |
74 | 74 |
75 #endif // UI_VIEWS_MUS_SCREEN_MUS_H_ | 75 #endif // UI_VIEWS_MUS_SCREEN_MUS_H_ |
OLD | NEW |