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 SERVICES_UI_DISPLAY_PLATFORM_SCREEN_OZONE_H_ | 5 #ifndef SERVICES_UI_DISPLAY_PLATFORM_SCREEN_OZONE_H_ |
6 #define SERVICES_UI_DISPLAY_PLATFORM_SCREEN_OZONE_H_ | 6 #define SERVICES_UI_DISPLAY_PLATFORM_SCREEN_OZONE_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <set> | 10 #include <set> |
(...skipping 10 matching lines...) Expand all Loading... |
21 #include "ui/display/display.h" | 21 #include "ui/display/display.h" |
22 #include "ui/display/types/fake_display_controller.h" | 22 #include "ui/display/types/fake_display_controller.h" |
23 | 23 |
24 namespace display { | 24 namespace display { |
25 | 25 |
26 // PlatformScreenOzone provides the necessary functionality to configure all | 26 // PlatformScreenOzone provides the necessary functionality to configure all |
27 // attached physical displays on the ozone platform. | 27 // attached physical displays on the ozone platform. |
28 class PlatformScreenOzone | 28 class PlatformScreenOzone |
29 : public PlatformScreen, | 29 : public PlatformScreen, |
30 public ui::DisplayConfigurator::Observer, | 30 public ui::DisplayConfigurator::Observer, |
31 public shell::InterfaceFactory<mojom::DisplayController>, | 31 public service_manager::InterfaceFactory<mojom::DisplayController>, |
32 public mojom::DisplayController { | 32 public mojom::DisplayController { |
33 public: | 33 public: |
34 PlatformScreenOzone(); | 34 PlatformScreenOzone(); |
35 ~PlatformScreenOzone() override; | 35 ~PlatformScreenOzone() override; |
36 | 36 |
37 // PlatformScreen: | 37 // PlatformScreen: |
38 void AddInterfaces(shell::InterfaceRegistry* registry) override; | 38 void AddInterfaces(service_manager::InterfaceRegistry* registry) override; |
39 void Init(PlatformScreenDelegate* delegate) override; | 39 void Init(PlatformScreenDelegate* delegate) override; |
40 void RequestCloseDisplay(int64_t display_id) override; | 40 void RequestCloseDisplay(int64_t display_id) override; |
41 int64_t GetPrimaryDisplayId() const override; | 41 int64_t GetPrimaryDisplayId() const override; |
42 | 42 |
43 // mojom::DisplayController: | 43 // mojom::DisplayController: |
44 void ToggleVirtualDisplay() override; | 44 void ToggleVirtualDisplay() override; |
45 | 45 |
46 private: | 46 private: |
47 // TODO(kylechar): This struct is just temporary until we migrate | 47 // TODO(kylechar): This struct is just temporary until we migrate |
48 // DisplayManager code out of ash so it can be used here. | 48 // DisplayManager code out of ash so it can be used here. |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 DisplayInfo DisplayInfoFromSnapshot(const ui::DisplaySnapshot& snapshot); | 95 DisplayInfo DisplayInfoFromSnapshot(const ui::DisplaySnapshot& snapshot); |
96 | 96 |
97 // ui::DisplayConfigurator::Observer: | 97 // ui::DisplayConfigurator::Observer: |
98 void OnDisplayModeChanged( | 98 void OnDisplayModeChanged( |
99 const ui::DisplayConfigurator::DisplayStateList& displays) override; | 99 const ui::DisplayConfigurator::DisplayStateList& displays) override; |
100 void OnDisplayModeChangeFailed( | 100 void OnDisplayModeChangeFailed( |
101 const ui::DisplayConfigurator::DisplayStateList& displays, | 101 const ui::DisplayConfigurator::DisplayStateList& displays, |
102 ui::MultipleDisplayState failed_new_state) override; | 102 ui::MultipleDisplayState failed_new_state) override; |
103 | 103 |
104 // mojo::InterfaceFactory<mojom::DisplayController>: | 104 // mojo::InterfaceFactory<mojom::DisplayController>: |
105 void Create(const shell::Identity& remote_identity, | 105 void Create(const service_manager::Identity& remote_identity, |
106 mojom::DisplayControllerRequest request) override; | 106 mojom::DisplayControllerRequest request) override; |
107 | 107 |
108 ui::DisplayConfigurator display_configurator_; | 108 ui::DisplayConfigurator display_configurator_; |
109 PlatformScreenDelegate* delegate_ = nullptr; | 109 PlatformScreenDelegate* delegate_ = nullptr; |
110 | 110 |
111 // If not null it provides a way to modify the display state when running off | 111 // If not null it provides a way to modify the display state when running off |
112 // device (eg. running mustash on Linux). | 112 // device (eg. running mustash on Linux). |
113 FakeDisplayController* fake_display_controller_ = nullptr; | 113 FakeDisplayController* fake_display_controller_ = nullptr; |
114 | 114 |
115 // Tracks if we've made a display configuration change and want to wait for | 115 // Tracks if we've made a display configuration change and want to wait for |
116 // the display configuration to update before making further changes. | 116 // the display configuration to update before making further changes. |
117 bool wait_for_display_config_update_ = false; | 117 bool wait_for_display_config_update_ = false; |
118 | 118 |
119 // TODO(kylechar): These values can/should be replaced by DisplayLayout. | 119 // TODO(kylechar): These values can/should be replaced by DisplayLayout. |
120 int64_t primary_display_id_ = display::Display::kInvalidDisplayID; | 120 int64_t primary_display_id_ = display::Display::kInvalidDisplayID; |
121 std::vector<DisplayInfo> cached_displays_; | 121 std::vector<DisplayInfo> cached_displays_; |
122 gfx::Point next_display_origin_; | 122 gfx::Point next_display_origin_; |
123 | 123 |
124 mojo::BindingSet<mojom::DisplayController> bindings_; | 124 mojo::BindingSet<mojom::DisplayController> bindings_; |
125 | 125 |
126 DISALLOW_COPY_AND_ASSIGN(PlatformScreenOzone); | 126 DISALLOW_COPY_AND_ASSIGN(PlatformScreenOzone); |
127 }; | 127 }; |
128 | 128 |
129 } // namespace display | 129 } // namespace display |
130 | 130 |
131 #endif // SERVICES_UI_DISPLAY_PLATFORM_SCREEN_OZONE_H_ | 131 #endif // SERVICES_UI_DISPLAY_PLATFORM_SCREEN_OZONE_H_ |
OLD | NEW |