| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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_FORWARDING_DISPLAY_DELEGATE_H_ | 5 #ifndef UI_DISPLAY_MANAGER_FORWARDING_DISPLAY_DELEGATE_H_ |
| 6 #define UI_DISPLAY_MANAGER_FORWARDING_DISPLAY_DELEGATE_H_ | 6 #define UI_DISPLAY_MANAGER_FORWARDING_DISPLAY_DELEGATE_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 const std::vector<GammaRampRGBEntry>& gamma_lut, | 62 const std::vector<GammaRampRGBEntry>& gamma_lut, |
| 63 const std::vector<float>& correction_matrix) override; | 63 const std::vector<float>& correction_matrix) override; |
| 64 void AddObserver(display::NativeDisplayObserver* observer) override; | 64 void AddObserver(display::NativeDisplayObserver* observer) override; |
| 65 void RemoveObserver(display::NativeDisplayObserver* observer) override; | 65 void RemoveObserver(display::NativeDisplayObserver* observer) override; |
| 66 FakeDisplayController* GetFakeDisplayController() override; | 66 FakeDisplayController* GetFakeDisplayController() override; |
| 67 | 67 |
| 68 // display::mojom::NativeDisplayObserver: | 68 // display::mojom::NativeDisplayObserver: |
| 69 void OnConfigurationChanged() override; | 69 void OnConfigurationChanged() override; |
| 70 | 70 |
| 71 private: | 71 private: |
| 72 // Stores display snapshots and forards them to |callback|. | 72 // Stores display snapshots and forwards pointers to |callback|. |
| 73 void StoreAndForwardDisplays( | 73 void StoreAndForwardDisplays( |
| 74 const GetDisplaysCallback& callback, | 74 const GetDisplaysCallback& callback, |
| 75 std::vector<std::unique_ptr<DisplaySnapshotMojo>> snapshots); | 75 std::vector<std::unique_ptr<DisplaySnapshotMojo>> snapshots); |
| 76 | 76 |
| 77 // Forwards display snapshot pointers to |callback|. |
| 78 void ForwardDisplays(const GetDisplaysCallback& callback); |
| 79 |
| 80 // True if we should use |delegate_|. This will be false if synchronous |
| 81 // GetDisplays() and Configure() are required. |
| 82 bool use_delegate_ = false; |
| 83 |
| 77 mojom::NativeDisplayDelegatePtr delegate_; | 84 mojom::NativeDisplayDelegatePtr delegate_; |
| 78 mojo::Binding<mojom::NativeDisplayObserver> binding_; | 85 mojo::Binding<mojom::NativeDisplayObserver> binding_; |
| 79 | 86 |
| 80 // Display snapshots are owned here but accessed via raw pointers elsewhere. | 87 // Display snapshots are owned here but accessed via raw pointers elsewhere. |
| 81 // Call OnDisplaySnapshotsInvalidated() on observers before invalidating them. | 88 // Call OnDisplaySnapshotsInvalidated() on observers before invalidating them. |
| 82 std::vector<std::unique_ptr<DisplaySnapshotMojo>> snapshots_; | 89 std::vector<std::unique_ptr<DisplaySnapshotMojo>> snapshots_; |
| 83 | 90 |
| 84 base::ObserverList<display::NativeDisplayObserver> observers_; | 91 base::ObserverList<display::NativeDisplayObserver> observers_; |
| 85 | 92 |
| 86 DISALLOW_COPY_AND_ASSIGN(ForwardingDisplayDelegate); | 93 DISALLOW_COPY_AND_ASSIGN(ForwardingDisplayDelegate); |
| 87 }; | 94 }; |
| 88 | 95 |
| 89 } // namespace display | 96 } // namespace display |
| 90 | 97 |
| 91 #endif // UI_DISPLAY_MANAGER_FORWARDING_DISPLAY_DELEGATE_H_ | 98 #endif // UI_DISPLAY_MANAGER_FORWARDING_DISPLAY_DELEGATE_H_ |
| OLD | NEW |