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> |
11 #include <vector> | 11 #include <vector> |
12 | 12 |
13 #include "base/callback.h" | 13 #include "base/callback.h" |
14 #include "base/macros.h" | 14 #include "base/macros.h" |
15 #include "mojo/public/cpp/bindings/binding_set.h" | 15 #include "mojo/public/cpp/bindings/binding_set.h" |
16 #include "services/shell/public/cpp/connection.h" | 16 #include "services/shell/public/cpp/connection.h" |
17 #include "services/shell/public/cpp/interface_factory.h" | 17 #include "services/shell/public/cpp/interface_factory.h" |
18 #include "services/ui/display/platform_screen.h" | 18 #include "services/ui/display/platform_screen.h" |
19 #include "services/ui/public/interfaces/display/display_controller.mojom.h" | 19 #include "services/ui/public/interfaces/display/display_controller.mojom.h" |
20 #include "ui/display/chromeos/display_configurator.h" | 20 #include "ui/display/chromeos/display_configurator.h" |
21 #include "ui/display/display.h" | 21 #include "ui/display/display.h" |
22 #include "ui/display/types/fake_display_controller.h" | |
22 | 23 |
23 namespace display { | 24 namespace display { |
24 | 25 |
25 // PlatformScreenOzone provides the necessary functionality to configure all | 26 // PlatformScreenOzone provides the necessary functionality to configure all |
26 // attached physical displays on the ozone platform. | 27 // attached physical displays on the ozone platform. |
27 class PlatformScreenOzone | 28 class PlatformScreenOzone |
28 : public PlatformScreen, | 29 : public PlatformScreen, |
29 public ui::DisplayConfigurator::Observer, | 30 public ui::DisplayConfigurator::Observer, |
30 public shell::InterfaceFactory<mojom::DisplayController>, | 31 public shell::InterfaceFactory<mojom::DisplayController>, |
31 public mojom::DisplayController { | 32 public mojom::DisplayController { |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
95 const ui::DisplayConfigurator::DisplayStateList& displays, | 96 const ui::DisplayConfigurator::DisplayStateList& displays, |
96 ui::MultipleDisplayState failed_new_state) override; | 97 ui::MultipleDisplayState failed_new_state) override; |
97 | 98 |
98 // mojo::InterfaceFactory<mojom::DisplayController>: | 99 // mojo::InterfaceFactory<mojom::DisplayController>: |
99 void Create(const shell::Identity& remote_identity, | 100 void Create(const shell::Identity& remote_identity, |
100 mojom::DisplayControllerRequest request) override; | 101 mojom::DisplayControllerRequest request) override; |
101 | 102 |
102 ui::DisplayConfigurator display_configurator_; | 103 ui::DisplayConfigurator display_configurator_; |
103 PlatformScreenDelegate* delegate_ = nullptr; | 104 PlatformScreenDelegate* delegate_ = nullptr; |
104 | 105 |
106 // If not null it provides a way to modify the display state when running off | |
msw
2016/09/15 19:30:08
optional nit: "when running without a device (ie.
kylechar
2016/09/15 21:35:40
It's the terminology Rob and I have been using, no
| |
107 // device. | |
108 FakeDisplayController* fake_display_controller_ = nullptr; | |
109 | |
110 // Tracks if we've made some type of change and want to wait for the display | |
111 // configuration to update before making further changes. | |
112 bool wait_for_display_update_ = false; | |
msw
2016/09/15 19:30:08
optional nit: specialize this flag and comment for
kylechar
2016/09/15 21:35:40
I'm not totally sure there is a case where we want
| |
113 | |
105 // TODO(kylechar): These values can/should be replaced by DisplayLayout. | 114 // TODO(kylechar): These values can/should be replaced by DisplayLayout. |
106 int64_t primary_display_id_ = display::Display::kInvalidDisplayID; | 115 int64_t primary_display_id_ = display::Display::kInvalidDisplayID; |
107 std::vector<DisplayInfo> cached_displays_; | 116 std::vector<DisplayInfo> cached_displays_; |
108 gfx::Point next_display_origin_; | 117 gfx::Point next_display_origin_; |
109 | 118 |
110 mojo::BindingSet<mojom::DisplayController> bindings_; | 119 mojo::BindingSet<mojom::DisplayController> bindings_; |
111 | 120 |
112 DISALLOW_COPY_AND_ASSIGN(PlatformScreenOzone); | 121 DISALLOW_COPY_AND_ASSIGN(PlatformScreenOzone); |
113 }; | 122 }; |
114 | 123 |
115 } // namespace display | 124 } // namespace display |
116 | 125 |
117 #endif // SERVICES_UI_DISPLAY_PLATFORM_SCREEN_OZONE_H_ | 126 #endif // SERVICES_UI_DISPLAY_PLATFORM_SCREEN_OZONE_H_ |
OLD | NEW |