| 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 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 | 117 |
| 118 // Initialize default display. | 118 // Initialize default display. |
| 119 void InitDefaultDisplay(); | 119 void InitDefaultDisplay(); |
| 120 | 120 |
| 121 // Initializes font related params that depends on display configuration. | 121 // Initializes font related params that depends on display configuration. |
| 122 void RefreshFontParams(); | 122 void RefreshFontParams(); |
| 123 | 123 |
| 124 // Returns the display layout used for current displays. | 124 // Returns the display layout used for current displays. |
| 125 const DisplayLayout& GetCurrentDisplayLayout() const; | 125 const DisplayLayout& GetCurrentDisplayLayout() const; |
| 126 | 126 |
| 127 // Returns the actual display layout after it has been resolved and applied. |
| 128 const DisplayLayout& GetCurrentResolvedDisplayLayout() const; |
| 129 |
| 127 // Returns the current display list. | 130 // Returns the current display list. |
| 128 DisplayIdList GetCurrentDisplayIdList() const; | 131 DisplayIdList GetCurrentDisplayIdList() const; |
| 129 | 132 |
| 130 // Sets the layout for the current display pair. The |layout| specifies the | 133 // Sets the layout for the current display pair. The |layout| specifies the |
| 131 // locaion of the displays relative to their parents. | 134 // locaion of the displays relative to their parents. |
| 132 void SetLayoutForCurrentDisplays(std::unique_ptr<DisplayLayout> layout); | 135 void SetLayoutForCurrentDisplays(std::unique_ptr<DisplayLayout> layout); |
| 133 | 136 |
| 134 // Returns display for given |id|; | 137 // Returns display for given |id|; |
| 135 const Display& GetDisplayForId(int64_t id) const; | 138 const Display& GetDisplayForId(int64_t id) const; |
| 136 | 139 |
| (...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 401 void UpdateNonPrimaryDisplayBoundsForLayout( | 404 void UpdateNonPrimaryDisplayBoundsForLayout( |
| 402 Displays* display_list, | 405 Displays* display_list, |
| 403 std::vector<size_t>* updated_indices); | 406 std::vector<size_t>* updated_indices); |
| 404 | 407 |
| 405 void CreateMirrorWindowIfAny(); | 408 void CreateMirrorWindowIfAny(); |
| 406 | 409 |
| 407 void RunPendingTasksForTest(); | 410 void RunPendingTasksForTest(); |
| 408 | 411 |
| 409 // Applies the |layout| and updates the bounds of displays in |display_list|. | 412 // Applies the |layout| and updates the bounds of displays in |display_list|. |
| 410 // |updated_ids| contains the ids for displays whose bounds have changed. | 413 // |updated_ids| contains the ids for displays whose bounds have changed. |
| 411 void ApplyDisplayLayout(const DisplayLayout& layout, | 414 void ApplyDisplayLayout(DisplayLayout* layout, |
| 412 Displays* display_list, | 415 Displays* display_list, |
| 413 std::vector<int64_t>* updated_ids); | 416 std::vector<int64_t>* updated_ids); |
| 414 | 417 |
| 415 Delegate* delegate_ = nullptr; // not owned. | 418 Delegate* delegate_ = nullptr; // not owned. |
| 416 | 419 |
| 417 std::unique_ptr<Screen> screen_; | 420 std::unique_ptr<Screen> screen_; |
| 418 | 421 |
| 419 std::unique_ptr<DisplayLayoutStore> layout_store_; | 422 std::unique_ptr<DisplayLayoutStore> layout_store_; |
| 420 | 423 |
| 424 std::unique_ptr<DisplayLayout> current_resolved_layout_; |
| 425 |
| 421 int64_t first_display_id_ = kInvalidDisplayId; | 426 int64_t first_display_id_ = kInvalidDisplayId; |
| 422 | 427 |
| 423 // List of current active displays. | 428 // List of current active displays. |
| 424 Displays active_display_list_; | 429 Displays active_display_list_; |
| 425 // This list does not include the displays that will be removed if | 430 // This list does not include the displays that will be removed if |
| 426 // |UpdateDisplaysWith| is under execution. | 431 // |UpdateDisplaysWith| is under execution. |
| 427 // See https://crbug.com/632755 | 432 // See https://crbug.com/632755 |
| 428 Displays active_only_display_list_; | 433 Displays active_only_display_list_; |
| 429 | 434 |
| 430 // True if active_display_list is being modified and has displays that are not | 435 // True if active_display_list is being modified and has displays that are not |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 465 base::ObserverList<DisplayObserver> observers_; | 470 base::ObserverList<DisplayObserver> observers_; |
| 466 | 471 |
| 467 base::WeakPtrFactory<DisplayManager> weak_ptr_factory_; | 472 base::WeakPtrFactory<DisplayManager> weak_ptr_factory_; |
| 468 | 473 |
| 469 DISALLOW_COPY_AND_ASSIGN(DisplayManager); | 474 DISALLOW_COPY_AND_ASSIGN(DisplayManager); |
| 470 }; | 475 }; |
| 471 | 476 |
| 472 } // namespace display | 477 } // namespace display |
| 473 | 478 |
| 474 #endif // UI_DISPLAY_MANAGER_DISPLAY_MANAGER_H_ | 479 #endif // UI_DISPLAY_MANAGER_DISPLAY_MANAGER_H_ |
| OLD | NEW |