OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_DISPLAY_CHROMEOS_DISPLAY_CONFIGURATOR_H_ | 5 #ifndef UI_DISPLAY_CHROMEOS_DISPLAY_CONFIGURATOR_H_ |
6 #define UI_DISPLAY_CHROMEOS_DISPLAY_CONFIGURATOR_H_ | 6 #define UI_DISPLAY_CHROMEOS_DISPLAY_CONFIGURATOR_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <map> | 10 #include <map> |
11 #include <queue> | 11 #include <queue> |
12 #include <string> | 12 #include <string> |
13 #include <vector> | 13 #include <vector> |
14 | 14 |
15 #include "base/event_types.h" | 15 #include "base/event_types.h" |
16 #include "base/memory/scoped_ptr.h" | 16 #include "base/memory/scoped_ptr.h" |
| 17 #include "base/memory/scoped_vector.h" |
17 #include "base/memory/weak_ptr.h" | 18 #include "base/memory/weak_ptr.h" |
18 #include "base/observer_list.h" | 19 #include "base/observer_list.h" |
19 #include "base/timer/timer.h" | 20 #include "base/timer/timer.h" |
20 #include "third_party/cros_system_api/dbus/service_constants.h" | 21 #include "third_party/cros_system_api/dbus/service_constants.h" |
| 22 #include "ui/display/chromeos/display_snapshot_virtual.h" |
21 #include "ui/display/chromeos/query_content_protection_task.h" | 23 #include "ui/display/chromeos/query_content_protection_task.h" |
22 #include "ui/display/display_export.h" | 24 #include "ui/display/display_export.h" |
23 #include "ui/display/types/display_constants.h" | 25 #include "ui/display/types/display_constants.h" |
24 #include "ui/display/types/native_display_observer.h" | 26 #include "ui/display/types/native_display_observer.h" |
| 27 #include "ui/display/util/display_util.h" |
25 #include "ui/gfx/geometry/size.h" | 28 #include "ui/gfx/geometry/size.h" |
26 | 29 |
27 namespace gfx { | 30 namespace gfx { |
28 class Point; | 31 class Point; |
29 class Size; | 32 class Size; |
30 } | 33 } |
31 | 34 |
32 namespace ui { | 35 namespace ui { |
33 struct DisplayConfigureRequest; | 36 struct DisplayConfigureRequest; |
34 struct GammaRampRGBEntry; | 37 struct GammaRampRGBEntry; |
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
262 int64_t display_id); | 265 int64_t display_id); |
263 | 266 |
264 // Updates the color calibration to |new_profile|. | 267 // Updates the color calibration to |new_profile|. |
265 bool SetColorCalibrationProfile(int64_t display_id, | 268 bool SetColorCalibrationProfile(int64_t display_id, |
266 ui::ColorCalibrationProfile new_profile); | 269 ui::ColorCalibrationProfile new_profile); |
267 | 270 |
268 // Sets the gamma ramp for |display_id| to the values in |lut|. | 271 // Sets the gamma ramp for |display_id| to the values in |lut|. |
269 bool SetGammaRamp(int64_t display_id, | 272 bool SetGammaRamp(int64_t display_id, |
270 const std::vector<GammaRampRGBEntry>& lut); | 273 const std::vector<GammaRampRGBEntry>& lut); |
271 | 274 |
| 275 // Enables/disables virtual display. |
| 276 int64_t AddVirtualDisplay(gfx::Size display_size); |
| 277 bool RemoveVirtualDisplay(int64_t display_id); |
| 278 |
272 private: | 279 private: |
273 class DisplayLayoutManagerImpl; | 280 class DisplayLayoutManagerImpl; |
274 | 281 |
275 // Mapping a client to its protection request. | 282 // Mapping a client to its protection request. |
276 typedef std::map<ContentProtectionClientId, ContentProtections> | 283 typedef std::map<ContentProtectionClientId, ContentProtections> |
277 ProtectionRequests; | 284 ProtectionRequests; |
278 | 285 |
279 // Performs platform specific delegate initialization. | 286 // Performs platform specific delegate initialization. |
280 scoped_ptr<NativeDisplayDelegate> CreatePlatformNativeDisplayDelegate(); | 287 scoped_ptr<NativeDisplayDelegate> CreatePlatformNativeDisplayDelegate(); |
281 | 288 |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
414 // Display controlled by an external entity. | 421 // Display controlled by an external entity. |
415 bool display_externally_controlled_; | 422 bool display_externally_controlled_; |
416 | 423 |
417 // True if a TakeControl or RelinquishControl has been called but the response | 424 // True if a TakeControl or RelinquishControl has been called but the response |
418 // hasn't arrived yet. | 425 // hasn't arrived yet. |
419 bool display_control_changing_; | 426 bool display_control_changing_; |
420 | 427 |
421 // Whether the displays are currently suspended. | 428 // Whether the displays are currently suspended. |
422 bool displays_suspended_; | 429 bool displays_suspended_; |
423 | 430 |
| 431 // Virtual display control. |
| 432 ScopedVector<DisplaySnapshot> virtual_display_snapshots_; |
| 433 |
| 434 // Last used virtual display id. |
| 435 uint8_t last_virtual_display_id_ = 0; |
| 436 |
424 scoped_ptr<DisplayLayoutManager> layout_manager_; | 437 scoped_ptr<DisplayLayoutManager> layout_manager_; |
425 | 438 |
426 scoped_ptr<UpdateDisplayConfigurationTask> configuration_task_; | 439 scoped_ptr<UpdateDisplayConfigurationTask> configuration_task_; |
427 | 440 |
428 // This must be the last variable. | 441 // This must be the last variable. |
429 base::WeakPtrFactory<DisplayConfigurator> weak_ptr_factory_; | 442 base::WeakPtrFactory<DisplayConfigurator> weak_ptr_factory_; |
430 | 443 |
431 DISALLOW_COPY_AND_ASSIGN(DisplayConfigurator); | 444 DISALLOW_COPY_AND_ASSIGN(DisplayConfigurator); |
432 }; | 445 }; |
433 | 446 |
434 } // namespace ui | 447 } // namespace ui |
435 | 448 |
436 #endif // UI_DISPLAY_CHROMEOS_DISPLAY_CONFIGURATOR_H_ | 449 #endif // UI_DISPLAY_CHROMEOS_DISPLAY_CONFIGURATOR_H_ |
OLD | NEW |