| 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 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 DisplayLayoutStore* layout_store() { return layout_store_.get(); } | 101 DisplayLayoutStore* layout_store() { return layout_store_.get(); } |
| 102 | 102 |
| 103 void set_delegate(Delegate* delegate) { delegate_ = delegate; } | 103 void set_delegate(Delegate* delegate) { delegate_ = delegate; } |
| 104 | 104 |
| 105 // When set to true, the DisplayManager calls OnDisplayMetricsChanged even if | 105 // When set to true, the DisplayManager calls OnDisplayMetricsChanged even if |
| 106 // the display's bounds didn't change. Used to swap primary display. | 106 // the display's bounds didn't change. Used to swap primary display. |
| 107 void set_force_bounds_changed(bool force_bounds_changed) { | 107 void set_force_bounds_changed(bool force_bounds_changed) { |
| 108 force_bounds_changed_ = force_bounds_changed; | 108 force_bounds_changed_ = force_bounds_changed; |
| 109 } | 109 } |
| 110 | 110 |
| 111 void set_configure_displays(bool configure_displays) { |
| 112 configure_displays_ = configure_displays; |
| 113 } |
| 114 |
| 111 // Returns the display id of the first display in the outupt list. | 115 // Returns the display id of the first display in the outupt list. |
| 112 int64_t first_display_id() const { return first_display_id_; } | 116 int64_t first_display_id() const { return first_display_id_; } |
| 113 | 117 |
| 114 // Initializes displays using command line flag. Returns false if no command | 118 // Initializes displays using command line flag. Returns false if no command |
| 115 // line flag was provided. | 119 // line flag was provided. |
| 116 bool InitFromCommandLine(); | 120 bool InitFromCommandLine(); |
| 117 | 121 |
| 118 // Initialize default display. | 122 // Initialize default display. |
| 119 void InitDefaultDisplay(); | 123 void InitDefaultDisplay(); |
| 120 | 124 |
| (...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 407 void RunPendingTasksForTest(); | 411 void RunPendingTasksForTest(); |
| 408 | 412 |
| 409 // Applies the |layout| and updates the bounds of displays in |display_list|. | 413 // Applies the |layout| and updates the bounds of displays in |display_list|. |
| 410 // |updated_ids| contains the ids for displays whose bounds have changed. | 414 // |updated_ids| contains the ids for displays whose bounds have changed. |
| 411 void ApplyDisplayLayout(const DisplayLayout& layout, | 415 void ApplyDisplayLayout(const DisplayLayout& layout, |
| 412 Displays* display_list, | 416 Displays* display_list, |
| 413 std::vector<int64_t>* updated_ids); | 417 std::vector<int64_t>* updated_ids); |
| 414 | 418 |
| 415 Delegate* delegate_ = nullptr; // not owned. | 419 Delegate* delegate_ = nullptr; // not owned. |
| 416 | 420 |
| 421 // When set to true, DisplayManager will use DisplayConfigurator to configure |
| 422 // displays. By default, this is set to true when running on device and false |
| 423 // when running off device. |
| 424 bool configure_displays_ = false; |
| 425 |
| 417 std::unique_ptr<Screen> screen_; | 426 std::unique_ptr<Screen> screen_; |
| 418 | 427 |
| 419 std::unique_ptr<DisplayLayoutStore> layout_store_; | 428 std::unique_ptr<DisplayLayoutStore> layout_store_; |
| 420 | 429 |
| 421 int64_t first_display_id_ = kInvalidDisplayId; | 430 int64_t first_display_id_ = kInvalidDisplayId; |
| 422 | 431 |
| 423 // List of current active displays. | 432 // List of current active displays. |
| 424 Displays active_display_list_; | 433 Displays active_display_list_; |
| 425 // This list does not include the displays that will be removed if | 434 // This list does not include the displays that will be removed if |
| 426 // |UpdateDisplaysWith| is under execution. | 435 // |UpdateDisplaysWith| is under execution. |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 465 base::ObserverList<DisplayObserver> observers_; | 474 base::ObserverList<DisplayObserver> observers_; |
| 466 | 475 |
| 467 base::WeakPtrFactory<DisplayManager> weak_ptr_factory_; | 476 base::WeakPtrFactory<DisplayManager> weak_ptr_factory_; |
| 468 | 477 |
| 469 DISALLOW_COPY_AND_ASSIGN(DisplayManager); | 478 DISALLOW_COPY_AND_ASSIGN(DisplayManager); |
| 470 }; | 479 }; |
| 471 | 480 |
| 472 } // namespace display | 481 } // namespace display |
| 473 | 482 |
| 474 #endif // UI_DISPLAY_MANAGER_DISPLAY_MANAGER_H_ | 483 #endif // UI_DISPLAY_MANAGER_DISPLAY_MANAGER_H_ |
| OLD | NEW |