| 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/native_display_observer.h" | |
| 20 #include "ui/display/display_constants.h" | |
| 21 #include "ui/display/display_export.h" | 19 #include "ui/display/display_export.h" |
| 20 #include "ui/display/types/chromeos/native_display_observer.h" |
| 21 #include "ui/display/types/display_constants.h" |
| 22 | 22 |
| 23 namespace gfx { | 23 namespace gfx { |
| 24 class Point; | 24 class Point; |
| 25 class Size; | 25 class Size; |
| 26 } | 26 } |
| 27 | 27 |
| 28 namespace ui { | 28 namespace ui { |
| 29 class DisplayMode; | 29 class DisplayMode; |
| 30 class DisplaySnapshot; | 30 class DisplaySnapshot; |
| 31 class NativeDisplayDelegate; | 31 class NativeDisplayDelegate; |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 175 return cached_displays_; | 175 return cached_displays_; |
| 176 } | 176 } |
| 177 | 177 |
| 178 void set_state_controller(StateController* controller) { | 178 void set_state_controller(StateController* controller) { |
| 179 state_controller_ = controller; | 179 state_controller_ = controller; |
| 180 } | 180 } |
| 181 void set_mirroring_controller(SoftwareMirroringController* controller) { | 181 void set_mirroring_controller(SoftwareMirroringController* controller) { |
| 182 mirroring_controller_ = controller; | 182 mirroring_controller_ = controller; |
| 183 } | 183 } |
| 184 | 184 |
| 185 // Replaces |native_display_delegate_| with |delegate| and sets | 185 // Replaces |native_display_delegate_| and |touchscreen_delegate_| with the 2 |
| 186 // |configure_display_| to true. Should be called before Init(). | 186 // delegates passed in and sets |configure_display_| to true. Should be called |
| 187 void SetNativeDisplayDelegateForTesting( | 187 // before Init(). |
| 188 scoped_ptr<NativeDisplayDelegate> delegate); | 188 void SetDelegatesForTesting( |
| 189 | 189 scoped_ptr<NativeDisplayDelegate> display_delegate, |
| 190 void SetTouchscreenDelegateForTesting( | 190 scoped_ptr<TouchscreenDelegate> touchscreen_delegate); |
| 191 scoped_ptr<TouchscreenDelegate> delegate); | |
| 192 | 191 |
| 193 // Sets the initial value of |power_state_|. Must be called before Start(). | 192 // Sets the initial value of |power_state_|. Must be called before Start(). |
| 194 void SetInitialDisplayPower(chromeos::DisplayPowerState power_state); | 193 void SetInitialDisplayPower(chromeos::DisplayPowerState power_state); |
| 195 | 194 |
| 196 // Initialization, must be called right after constructor. | 195 // Initialization, must be called right after constructor. |
| 197 // |is_panel_fitting_enabled| indicates hardware panel fitting support. | 196 // |is_panel_fitting_enabled| indicates hardware panel fitting support. |
| 198 void Init(bool is_panel_fitting_enabled); | 197 void Init(bool is_panel_fitting_enabled); |
| 199 | 198 |
| 200 // Does initial configuration of displays during startup. | 199 // Does initial configuration of displays during startup. |
| 201 // If |background_color_argb| is non zero and there are multiple displays, | 200 // If |background_color_argb| is non zero and there are multiple displays, |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 270 bool SetColorCalibrationProfile(int64_t display_id, | 269 bool SetColorCalibrationProfile(int64_t display_id, |
| 271 ui::ColorCalibrationProfile new_profile); | 270 ui::ColorCalibrationProfile new_profile); |
| 272 | 271 |
| 273 private: | 272 private: |
| 274 // Mapping a display_id to a protection request bitmask. | 273 // Mapping a display_id to a protection request bitmask. |
| 275 typedef std::map<int64_t, uint32_t> ContentProtections; | 274 typedef std::map<int64_t, uint32_t> ContentProtections; |
| 276 // Mapping a client to its protection request. | 275 // Mapping a client to its protection request. |
| 277 typedef std::map<ContentProtectionClientId, ContentProtections> | 276 typedef std::map<ContentProtectionClientId, ContentProtections> |
| 278 ProtectionRequests; | 277 ProtectionRequests; |
| 279 | 278 |
| 279 // If |native_display_delegate_| and |touchscreen_delegate_| are not set, then |
| 280 // set them to the passed in values. |
| 281 void InitializeDelegates( |
| 282 scoped_ptr<NativeDisplayDelegate> display_delegate, |
| 283 scoped_ptr<TouchscreenDelegate> touchscreen_delegate); |
| 284 |
| 285 // Performs platform specific delegate initialization. |
| 286 void PlatformInitialize(); |
| 287 |
| 280 // Updates |cached_displays_| to contain currently-connected displays. Calls | 288 // Updates |cached_displays_| to contain currently-connected displays. Calls |
| 281 // |delegate_->GetDisplays()| and then does additional work, like finding the | 289 // |delegate_->GetDisplays()| and then does additional work, like finding the |
| 282 // mirror mode and setting user-preferred modes. Note that the server must be | 290 // mirror mode and setting user-preferred modes. Note that the server must be |
| 283 // grabbed via |delegate_->GrabServer()| first. | 291 // grabbed via |delegate_->GrabServer()| first. |
| 284 void UpdateCachedDisplays(); | 292 void UpdateCachedDisplays(); |
| 285 | 293 |
| 286 // Helper method for UpdateCachedDisplays() that initializes the passed-in | 294 // Helper method for UpdateCachedDisplays() that initializes the passed-in |
| 287 // displays' |mirror_mode| fields by looking for a mode in |internal_display| | 295 // displays' |mirror_mode| fields by looking for a mode in |internal_display| |
| 288 // and |external_display| having the same resolution. Returns false if a | 296 // and |external_display| having the same resolution. Returns false if a |
| 289 // shared | 297 // shared |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 393 | 401 |
| 394 // Display protection requests of each client. | 402 // Display protection requests of each client. |
| 395 ProtectionRequests client_protection_requests_; | 403 ProtectionRequests client_protection_requests_; |
| 396 | 404 |
| 397 DISALLOW_COPY_AND_ASSIGN(DisplayConfigurator); | 405 DISALLOW_COPY_AND_ASSIGN(DisplayConfigurator); |
| 398 }; | 406 }; |
| 399 | 407 |
| 400 } // namespace ui | 408 } // namespace ui |
| 401 | 409 |
| 402 #endif // UI_DISPLAY_CHROMEOS_DISPLAY_CONFIGURATOR_H_ | 410 #endif // UI_DISPLAY_CHROMEOS_DISPLAY_CONFIGURATOR_H_ |
| OLD | NEW |