| 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_UPDATE_DISPLAY_CONFIGURATION_TASK_H_ | 5 #ifndef UI_DISPLAY_CHROMEOS_UPDATE_DISPLAY_CONFIGURATION_TASK_H_ |
| 6 #define UI_DISPLAY_CHROMEOS_UPDATE_DISPLAY_CONFIGURATION_TASK_H_ | 6 #define UI_DISPLAY_CHROMEOS_UPDATE_DISPLAY_CONFIGURATION_TASK_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 UpdateDisplayConfigurationTask(NativeDisplayDelegate* delegate, | 28 UpdateDisplayConfigurationTask(NativeDisplayDelegate* delegate, |
| 29 DisplayLayoutManager* layout_manager, | 29 DisplayLayoutManager* layout_manager, |
| 30 MultipleDisplayState new_display_state, | 30 MultipleDisplayState new_display_state, |
| 31 chromeos::DisplayPowerState new_power_state, | 31 chromeos::DisplayPowerState new_power_state, |
| 32 int power_flags, | 32 int power_flags, |
| 33 uint32_t background_color_argb, | 33 uint32_t background_color_argb, |
| 34 bool force_configure, | 34 bool force_configure, |
| 35 const ResponseCallback& callback); | 35 const ResponseCallback& callback); |
| 36 ~UpdateDisplayConfigurationTask(); | 36 ~UpdateDisplayConfigurationTask(); |
| 37 | 37 |
| 38 // The pointers to the DisplaySnapshots in this vector are owned by |
| 39 // DisplayConfigurator. |
| 40 void set_virtual_display_snapshots(std::vector<DisplaySnapshot*> snapshots) { |
| 41 virtual_display_snapshots_ = snapshots; |
| 42 } |
| 43 |
| 38 void Run(); | 44 void Run(); |
| 39 | 45 |
| 40 private: | 46 private: |
| 41 // Callback to NativeDisplayDelegate::GetDisplays(). | 47 // Callback to NativeDisplayDelegate::GetDisplays(). |
| 42 void OnDisplaysUpdated(const std::vector<DisplaySnapshot*>& displays); | 48 void OnDisplaysUpdated(const std::vector<DisplaySnapshot*>& displays); |
| 43 | 49 |
| 44 // Callback to ConfigureDisplaysTask used to process the result of a display | 50 // Callback to ConfigureDisplaysTask used to process the result of a display |
| 45 // configuration run. | 51 // configuration run. |
| 46 void OnStateEntered(ConfigureDisplaysTask::Status status); | 52 void OnStateEntered(ConfigureDisplaysTask::Status status); |
| 47 | 53 |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 bool force_configure_; | 91 bool force_configure_; |
| 86 | 92 |
| 87 // Used to signal that the task has finished. | 93 // Used to signal that the task has finished. |
| 88 ResponseCallback callback_; | 94 ResponseCallback callback_; |
| 89 | 95 |
| 90 bool force_dpms_; | 96 bool force_dpms_; |
| 91 | 97 |
| 92 // List of updated displays. | 98 // List of updated displays. |
| 93 std::vector<DisplaySnapshot*> cached_displays_; | 99 std::vector<DisplaySnapshot*> cached_displays_; |
| 94 | 100 |
| 101 // Vector of unowned VirtualDisplaySnapshots to be added when doing the task. |
| 102 std::vector<DisplaySnapshot*> virtual_display_snapshots_; |
| 103 |
| 95 gfx::Size framebuffer_size_; | 104 gfx::Size framebuffer_size_; |
| 96 | 105 |
| 97 scoped_ptr<ConfigureDisplaysTask> configure_task_; | 106 scoped_ptr<ConfigureDisplaysTask> configure_task_; |
| 98 | 107 |
| 99 base::WeakPtrFactory<UpdateDisplayConfigurationTask> weak_ptr_factory_; | 108 base::WeakPtrFactory<UpdateDisplayConfigurationTask> weak_ptr_factory_; |
| 100 | 109 |
| 101 DISALLOW_COPY_AND_ASSIGN(UpdateDisplayConfigurationTask); | 110 DISALLOW_COPY_AND_ASSIGN(UpdateDisplayConfigurationTask); |
| 102 }; | 111 }; |
| 103 | 112 |
| 104 } // namespace ui | 113 } // namespace ui |
| 105 | 114 |
| 106 #endif // UI_DISPLAY_CHROMEOS_UPDATE_DISPLAY_CONFIGURATION_TASK_H_ | 115 #endif // UI_DISPLAY_CHROMEOS_UPDATE_DISPLAY_CONFIGURATION_TASK_H_ |
| OLD | NEW |