| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_MANAGER_DISPLAY_MANAGER_H_ | 5 #ifndef UI_DISPLAY_MANAGER_DISPLAY_MANAGER_H_ |
| 6 #define UI_DISPLAY_MANAGER_DISPLAY_MANAGER_H_ | 6 #define UI_DISPLAY_MANAGER_DISPLAY_MANAGER_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 class Screen; | 43 class Screen; |
| 44 | 44 |
| 45 namespace test { | 45 namespace test { |
| 46 class DisplayManagerTestApi; | 46 class DisplayManagerTestApi; |
| 47 } | 47 } |
| 48 | 48 |
| 49 // DisplayManager maintains the current display configurations, | 49 // DisplayManager maintains the current display configurations, |
| 50 // and notifies observers when configuration changes. | 50 // and notifies observers when configuration changes. |
| 51 class DISPLAY_MANAGER_EXPORT DisplayManager | 51 class DISPLAY_MANAGER_EXPORT DisplayManager |
| 52 #if defined(OS_CHROMEOS) | 52 #if defined(OS_CHROMEOS) |
| 53 : public ui::DisplayConfigurator::SoftwareMirroringController | 53 : public DisplayConfigurator::SoftwareMirroringController |
| 54 #endif | 54 #endif |
| 55 { | 55 { |
| 56 public: | 56 public: |
| 57 class DISPLAY_MANAGER_EXPORT Delegate { | 57 class DISPLAY_MANAGER_EXPORT Delegate { |
| 58 public: | 58 public: |
| 59 virtual ~Delegate() {} | 59 virtual ~Delegate() {} |
| 60 | 60 |
| 61 // Create or updates the mirroring window with |display_info_list|. | 61 // Create or updates the mirroring window with |display_info_list|. |
| 62 virtual void CreateOrUpdateMirroringDisplay( | 62 virtual void CreateOrUpdateMirroringDisplay( |
| 63 const DisplayInfoList& display_info_list) = 0; | 63 const DisplayInfoList& display_info_list) = 0; |
| 64 | 64 |
| 65 // Closes the mirror window if not necessary. | 65 // Closes the mirror window if not necessary. |
| 66 virtual void CloseMirroringDisplayIfNotNecessary() = 0; | 66 virtual void CloseMirroringDisplayIfNotNecessary() = 0; |
| 67 | 67 |
| 68 // Called before and after the display configuration changes. When | 68 // Called before and after the display configuration changes. When |
| 69 // |clear_focus| is true, the implementation should deactivate the active | 69 // |clear_focus| is true, the implementation should deactivate the active |
| 70 // window and set the focus window to NULL. | 70 // window and set the focus window to NULL. |
| 71 virtual void PreDisplayConfigurationChange(bool clear_focus) = 0; | 71 virtual void PreDisplayConfigurationChange(bool clear_focus) = 0; |
| 72 virtual void PostDisplayConfigurationChange(bool must_clear_window) = 0; | 72 virtual void PostDisplayConfigurationChange(bool must_clear_window) = 0; |
| 73 | 73 |
| 74 #if defined(OS_CHROMEOS) | 74 #if defined(OS_CHROMEOS) |
| 75 // Get the ui::DisplayConfigurator. | 75 // Get the DisplayConfigurator. |
| 76 virtual ui::DisplayConfigurator* display_configurator() = 0; | 76 virtual DisplayConfigurator* display_configurator() = 0; |
| 77 #endif | 77 #endif |
| 78 }; | 78 }; |
| 79 | 79 |
| 80 // How the second display will be used. | 80 // How the second display will be used. |
| 81 // 1) EXTENDED mode extends the desktop to the second dislpay. | 81 // 1) EXTENDED mode extends the desktop to the second dislpay. |
| 82 // 2) MIRRORING mode copies the content of the primary display to | 82 // 2) MIRRORING mode copies the content of the primary display to |
| 83 // the 2nd display. (Software Mirroring). | 83 // the 2nd display. (Software Mirroring). |
| 84 // 3) UNIFIED mode creates single desktop across multiple displays. | 84 // 3) UNIFIED mode creates single desktop across multiple displays. |
| 85 enum MultiDisplayMode { | 85 enum MultiDisplayMode { |
| 86 EXTENDED = 0, | 86 EXTENDED = 0, |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 172 // |overscan_insets| is null if the display has no custom overscan insets. | 172 // |overscan_insets| is null if the display has no custom overscan insets. |
| 173 // |touch_calibration_data| is null if the display has no touch calibration | 173 // |touch_calibration_data| is null if the display has no touch calibration |
| 174 // associated data. | 174 // associated data. |
| 175 void RegisterDisplayProperty( | 175 void RegisterDisplayProperty( |
| 176 int64_t display_id, | 176 int64_t display_id, |
| 177 Display::Rotation rotation, | 177 Display::Rotation rotation, |
| 178 float ui_scale, | 178 float ui_scale, |
| 179 const gfx::Insets* overscan_insets, | 179 const gfx::Insets* overscan_insets, |
| 180 const gfx::Size& resolution_in_pixels, | 180 const gfx::Size& resolution_in_pixels, |
| 181 float device_scale_factor, | 181 float device_scale_factor, |
| 182 ui::ColorCalibrationProfile color_profile, | 182 ColorCalibrationProfile color_profile, |
| 183 const TouchCalibrationData* touch_calibration_data); | 183 const TouchCalibrationData* touch_calibration_data); |
| 184 | 184 |
| 185 // Register stored rotation properties for the internal display. | 185 // Register stored rotation properties for the internal display. |
| 186 void RegisterDisplayRotationProperties(bool rotation_lock, | 186 void RegisterDisplayRotationProperties(bool rotation_lock, |
| 187 Display::Rotation rotation); | 187 Display::Rotation rotation); |
| 188 | 188 |
| 189 // Returns the stored rotation lock preference if it has been loaded, | 189 // Returns the stored rotation lock preference if it has been loaded, |
| 190 // otherwise false. | 190 // otherwise false. |
| 191 bool registered_internal_display_rotation_lock() const { | 191 bool registered_internal_display_rotation_lock() const { |
| 192 return registered_internal_display_rotation_lock_; | 192 return registered_internal_display_rotation_lock_; |
| (...skipping 17 matching lines...) Expand all Loading... |
| 210 // Tells if the virtual resolution feature is enabled. | 210 // Tells if the virtual resolution feature is enabled. |
| 211 bool IsDisplayUIScalingEnabled() const; | 211 bool IsDisplayUIScalingEnabled() const; |
| 212 | 212 |
| 213 // Returns the current overscan insets for the specified |display_id|. | 213 // Returns the current overscan insets for the specified |display_id|. |
| 214 // Returns an empty insets (0, 0, 0, 0) if no insets are specified for the | 214 // Returns an empty insets (0, 0, 0, 0) if no insets are specified for the |
| 215 // display. | 215 // display. |
| 216 gfx::Insets GetOverscanInsets(int64_t display_id) const; | 216 gfx::Insets GetOverscanInsets(int64_t display_id) const; |
| 217 | 217 |
| 218 // Sets the color calibration of the display to |profile|. | 218 // Sets the color calibration of the display to |profile|. |
| 219 void SetColorCalibrationProfile(int64_t display_id, | 219 void SetColorCalibrationProfile(int64_t display_id, |
| 220 ui::ColorCalibrationProfile profile); | 220 ColorCalibrationProfile profile); |
| 221 | 221 |
| 222 // Called when display configuration has changed. The new display | 222 // Called when display configuration has changed. The new display |
| 223 // configurations is passed as a vector of Display object, which contains each | 223 // configurations is passed as a vector of Display object, which contains each |
| 224 // display's new infomration. | 224 // display's new infomration. |
| 225 void OnNativeDisplaysChanged( | 225 void OnNativeDisplaysChanged( |
| 226 const std::vector<ManagedDisplayInfo>& display_info_list); | 226 const std::vector<ManagedDisplayInfo>& display_info_list); |
| 227 | 227 |
| 228 // Updates the internal display data and notifies observers about the changes. | 228 // Updates the internal display data and notifies observers about the changes. |
| 229 void UpdateDisplaysWith( | 229 void UpdateDisplaysWith( |
| 230 const std::vector<ManagedDisplayInfo>& display_info_list); | 230 const std::vector<ManagedDisplayInfo>& display_info_list); |
| (...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 474 base::ObserverList<DisplayObserver> observers_; | 474 base::ObserverList<DisplayObserver> observers_; |
| 475 | 475 |
| 476 base::WeakPtrFactory<DisplayManager> weak_ptr_factory_; | 476 base::WeakPtrFactory<DisplayManager> weak_ptr_factory_; |
| 477 | 477 |
| 478 DISALLOW_COPY_AND_ASSIGN(DisplayManager); | 478 DISALLOW_COPY_AND_ASSIGN(DisplayManager); |
| 479 }; | 479 }; |
| 480 | 480 |
| 481 } // namespace display | 481 } // namespace display |
| 482 | 482 |
| 483 #endif // UI_DISPLAY_MANAGER_DISPLAY_MANAGER_H_ | 483 #endif // UI_DISPLAY_MANAGER_DISPLAY_MANAGER_H_ |
| OLD | NEW |