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 ASH_DISPLAY_DISPLAY_MANAGER_H_ | 5 #ifndef ASH_DISPLAY_DISPLAY_MANAGER_H_ |
6 #define ASH_DISPLAY_DISPLAY_MANAGER_H_ | 6 #define ASH_DISPLAY_DISPLAY_MANAGER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
243 // Returns the number of connected displays. This returns 2 | 243 // Returns the number of connected displays. This returns 2 |
244 // when displays are mirrored. | 244 // when displays are mirrored. |
245 size_t num_connected_displays() const { return num_connected_displays_; } | 245 size_t num_connected_displays() const { return num_connected_displays_; } |
246 | 246 |
247 // Returns the mirroring status. | 247 // Returns the mirroring status. |
248 bool IsInMirrorMode() const; | 248 bool IsInMirrorMode() const; |
249 int64 mirroring_display_id() const { return mirroring_display_id_; } | 249 int64 mirroring_display_id() const { return mirroring_display_id_; } |
250 const DisplayList& software_mirroring_display_list() const { | 250 const DisplayList& software_mirroring_display_list() const { |
251 return software_mirroring_display_list_; | 251 return software_mirroring_display_list_; |
252 } | 252 } |
| 253 |
| 254 // Sets/gets if the unified desktop feature is enabled. |
| 255 void SetUnifiedDesktopEnabled(bool enabled); |
| 256 bool unified_desktop_enabled() const { return unified_desktop_enabled_; } |
| 257 |
| 258 // Returns true if it's in unified desktop mode. |
253 bool IsInUnifiedMode() const; | 259 bool IsInUnifiedMode() const; |
254 | 260 |
255 // Returns the display used for software mirrroring. Returns invalid | 261 // Returns the display used for software mirrroring. Returns invalid |
256 // display if not found. | 262 // display if not found. |
257 const gfx::Display GetMirroringDisplayById(int64 id) const; | 263 const gfx::Display GetMirroringDisplayById(int64 id) const; |
258 | 264 |
259 // Retuns the display info associated with |display_id|. | 265 // Retuns the display info associated with |display_id|. |
260 const DisplayInfo& GetDisplayInfo(int64 display_id) const; | 266 const DisplayInfo& GetDisplayInfo(int64 display_id) const; |
261 | 267 |
262 // Returns the human-readable name for the display |id|. | 268 // Returns the human-readable name for the display |id|. |
(...skipping 12 matching lines...) Expand all Loading... |
275 // of on a device. | 281 // of on a device. |
276 void AddRemoveDisplay(); | 282 void AddRemoveDisplay(); |
277 void ToggleDisplayScaleFactor(); | 283 void ToggleDisplayScaleFactor(); |
278 | 284 |
279 // SoftwareMirroringController override: | 285 // SoftwareMirroringController override: |
280 #if defined(OS_CHROMEOS) | 286 #if defined(OS_CHROMEOS) |
281 void SetSoftwareMirroring(bool enabled) override; | 287 void SetSoftwareMirroring(bool enabled) override; |
282 bool SoftwareMirroringEnabled() const override; | 288 bool SoftwareMirroringEnabled() const override; |
283 #endif | 289 #endif |
284 | 290 |
285 // Sets/gets multi display mode. | 291 // Sets/gets default multi display mode. |
| 292 void SetDefaultMultiDisplayModeForCurrentDisplays(MultiDisplayMode mode); |
| 293 MultiDisplayMode current_default_multi_display_mode() const { |
| 294 return current_default_multi_display_mode_; |
| 295 } |
| 296 |
| 297 // Sets multi display mode. |
286 void SetMultiDisplayMode(MultiDisplayMode mode); | 298 void SetMultiDisplayMode(MultiDisplayMode mode); |
287 | 299 |
288 // Sets/gets default multi display mode. | |
289 void SetDefaultMultiDisplayMode(MultiDisplayMode mode); | |
290 MultiDisplayMode default_multi_display_mode() const { | |
291 return default_multi_display_mode_; | |
292 } | |
293 | |
294 // Reconfigure display configuration using the same | 300 // Reconfigure display configuration using the same |
295 // physical display. TODO(oshima): Refactor and move this | 301 // physical display. TODO(oshima): Refactor and move this |
296 // impl to |SetDefaultMultiDisplayMode|. | 302 // impl to |SetDefaultMultiDisplayMode|. |
297 void ReconfigureDisplays(); | 303 void ReconfigureDisplays(); |
298 | 304 |
299 // Update the bounds of the display given by |display_id|. | 305 // Update the bounds of the display given by |display_id|. |
300 bool UpdateDisplayBounds(int64 display_id, | 306 bool UpdateDisplayBounds(int64 display_id, |
301 const gfx::Rect& new_bounds); | 307 const gfx::Rect& new_bounds); |
302 | 308 |
303 // Creates mirror window asynchronously if the software mirror mode | 309 // Creates mirror window asynchronously if the software mirror mode |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
414 std::map<int64, DisplayMode> display_modes_; | 420 std::map<int64, DisplayMode> display_modes_; |
415 | 421 |
416 // When set to true, the host window's resize event updates | 422 // When set to true, the host window's resize event updates |
417 // the display's size. This is set to true when running on | 423 // the display's size. This is set to true when running on |
418 // desktop environment (for debugging) so that resizing the host | 424 // desktop environment (for debugging) so that resizing the host |
419 // window will update the display properly. This is set to false | 425 // window will update the display properly. This is set to false |
420 // on device as well as during the unit tests. | 426 // on device as well as during the unit tests. |
421 bool change_display_upon_host_resize_; | 427 bool change_display_upon_host_resize_; |
422 | 428 |
423 MultiDisplayMode multi_display_mode_; | 429 MultiDisplayMode multi_display_mode_; |
424 MultiDisplayMode default_multi_display_mode_; | 430 MultiDisplayMode current_default_multi_display_mode_; |
425 | 431 |
426 int64 mirroring_display_id_; | 432 int64 mirroring_display_id_; |
427 DisplayList software_mirroring_display_list_; | 433 DisplayList software_mirroring_display_list_; |
428 | 434 |
429 // User preference for rotation lock of the internal display. | 435 // User preference for rotation lock of the internal display. |
430 bool registered_internal_display_rotation_lock_; | 436 bool registered_internal_display_rotation_lock_; |
431 | 437 |
432 // User preference for the rotation of the internal display. | 438 // User preference for the rotation of the internal display. |
433 gfx::Display::Rotation registered_internal_display_rotation_; | 439 gfx::Display::Rotation registered_internal_display_rotation_; |
434 | 440 |
| 441 bool unified_desktop_enabled_; |
| 442 |
435 base::WeakPtrFactory<DisplayManager> weak_ptr_factory_; | 443 base::WeakPtrFactory<DisplayManager> weak_ptr_factory_; |
436 | 444 |
437 DISALLOW_COPY_AND_ASSIGN(DisplayManager); | 445 DISALLOW_COPY_AND_ASSIGN(DisplayManager); |
438 }; | 446 }; |
439 | 447 |
440 } // namespace ash | 448 } // namespace ash |
441 | 449 |
442 #endif // ASH_DISPLAY_DISPLAY_MANAGER_H_ | 450 #endif // ASH_DISPLAY_DISPLAY_MANAGER_H_ |
OLD | NEW |