Chromium Code Reviews| 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 <string> | 11 #include <string> |
| 12 #include <vector> | 12 #include <vector> |
| 13 | 13 |
| 14 #include "base/event_types.h" | 14 #include "base/event_types.h" |
| 15 #include "base/memory/scoped_ptr.h" | 15 #include "base/memory/scoped_ptr.h" |
| 16 #include "base/observer_list.h" | 16 #include "base/observer_list.h" |
| 17 #include "base/timer/timer.h" | 17 #include "base/timer/timer.h" |
| 18 #include "third_party/cros_system_api/dbus/service_constants.h" | 18 #include "third_party/cros_system_api/dbus/service_constants.h" |
| 19 #include "ui/display/chromeos/configure_displays_task.h" | |
| 19 #include "ui/display/display_export.h" | 20 #include "ui/display/display_export.h" |
| 20 #include "ui/display/types/display_constants.h" | 21 #include "ui/display/types/display_constants.h" |
| 21 #include "ui/display/types/native_display_observer.h" | 22 #include "ui/display/types/native_display_observer.h" |
| 22 #include "ui/gfx/geometry/size.h" | 23 #include "ui/gfx/geometry/size.h" |
| 23 | 24 |
| 24 namespace gfx { | 25 namespace gfx { |
| 25 class Point; | 26 class Point; |
| 26 class Size; | 27 class Size; |
| 27 } | 28 } |
| 28 | 29 |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 87 // Interface for classes that implement software based mirroring. | 88 // Interface for classes that implement software based mirroring. |
| 88 class SoftwareMirroringController { | 89 class SoftwareMirroringController { |
| 89 public: | 90 public: |
| 90 virtual ~SoftwareMirroringController() {} | 91 virtual ~SoftwareMirroringController() {} |
| 91 | 92 |
| 92 // Called when the hardware mirroring failed. | 93 // Called when the hardware mirroring failed. |
| 93 virtual void SetSoftwareMirroring(bool enabled) = 0; | 94 virtual void SetSoftwareMirroring(bool enabled) = 0; |
| 94 virtual bool SoftwareMirroringEnabled() const = 0; | 95 virtual bool SoftwareMirroringEnabled() const = 0; |
| 95 }; | 96 }; |
| 96 | 97 |
| 98 class DisplayLayoutManager { | |
| 99 public: | |
| 100 virtual ~DisplayLayoutManager() {} | |
| 101 | |
| 102 virtual SoftwareMirroringController* GetSoftwareMirroringController() | |
| 103 const = 0; | |
| 104 | |
| 105 virtual StateController* GetStateController() const = 0; | |
| 106 | |
| 107 // Returns the current display state. | |
| 108 virtual MultipleDisplayState GetDisplayState() const = 0; | |
| 109 | |
| 110 // Returns the current power state. | |
| 111 virtual chromeos::DisplayPowerState GetPowerState() const = 0; | |
| 112 | |
| 113 // Parses the displays and adds |mirror_mode| and |selected_mode|. | |
|
Daniel Erat
2014/12/11 23:34:07
the mirror_mode and selected_mode mentions seem co
| |
| 114 // TODO(dnicoara): This operation doesn't depend on state and could be done | |
| 115 // directly in |GetDisplayLayout()|. Though I need to make sure that there | |
| 116 // are no uses for those fields outside DisplayConfigurator. | |
| 117 virtual std::vector<DisplayState> ParseDisplays( | |
| 118 const std::vector<DisplaySnapshot*>& displays) const = 0; | |
| 119 | |
| 120 // Based on the given |displays|, display state and power state, it will | |
| 121 // create display configuration requests which will then be used to | |
| 122 // configure the hardware. The requested configuration is stored in | |
| 123 // |requests| and |framebuffer_size|. | |
| 124 virtual bool GetDisplayLayout( | |
| 125 const std::vector<DisplayState>& displays, | |
| 126 MultipleDisplayState new_display_state, | |
| 127 chromeos::DisplayPowerState new_power_state, | |
| 128 std::vector<DisplayConfigureRequest>* requests, | |
| 129 gfx::Size* framebuffer_size) const = 0; | |
| 130 }; | |
| 131 | |
| 97 // Helper class used by tests. | 132 // Helper class used by tests. |
| 98 class TestApi { | 133 class TestApi { |
| 99 public: | 134 public: |
| 100 TestApi(DisplayConfigurator* configurator) : configurator_(configurator) {} | 135 TestApi(DisplayConfigurator* configurator) : configurator_(configurator) {} |
| 101 ~TestApi() {} | 136 ~TestApi() {} |
| 102 | 137 |
| 103 // If |configure_timer_| is started, stops the timer, runs | 138 // If |configure_timer_| is started, stops the timer, runs |
| 104 // ConfigureDisplays(), and returns true; returns false otherwise. | 139 // ConfigureDisplays(), and returns true; returns false otherwise. |
| 105 bool TriggerConfigureTimeout() WARN_UNUSED_RESULT; | 140 bool TriggerConfigureTimeout() WARN_UNUSED_RESULT; |
| 106 | 141 |
| (...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 360 | 395 |
| 361 // Display controlled by an external entity. | 396 // Display controlled by an external entity. |
| 362 bool display_externally_controlled_; | 397 bool display_externally_controlled_; |
| 363 | 398 |
| 364 DISALLOW_COPY_AND_ASSIGN(DisplayConfigurator); | 399 DISALLOW_COPY_AND_ASSIGN(DisplayConfigurator); |
| 365 }; | 400 }; |
| 366 | 401 |
| 367 } // namespace ui | 402 } // namespace ui |
| 368 | 403 |
| 369 #endif // UI_DISPLAY_CHROMEOS_DISPLAY_CONFIGURATOR_H_ | 404 #endif // UI_DISPLAY_CHROMEOS_DISPLAY_CONFIGURATOR_H_ |
| OLD | NEW |