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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 forards them 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 // NOTE: this may be null in tests. |
77 mojom::NativeDisplayDelegatePtr delegate_; | 78 mojom::NativeDisplayDelegatePtr delegate_; |
78 mojo::Binding<mojom::NativeDisplayObserver> binding_; | 79 mojo::Binding<mojom::NativeDisplayObserver> binding_; |
79 | 80 |
80 // Display snapshots are owned here but accessed via raw pointers elsewhere. | 81 // Display snapshots are owned here but accessed via raw pointers elsewhere. |
81 // Call OnDisplaySnapshotsInvalidated() on observers before invalidating them. | 82 // Call OnDisplaySnapshotsInvalidated() on observers before invalidating them. |
82 std::vector<std::unique_ptr<DisplaySnapshotMojo>> snapshots_; | 83 std::vector<std::unique_ptr<DisplaySnapshotMojo>> snapshots_; |
83 | 84 |
84 base::ObserverList<display::NativeDisplayObserver> observers_; | 85 base::ObserverList<display::NativeDisplayObserver> observers_; |
85 | 86 |
86 DISALLOW_COPY_AND_ASSIGN(ForwardingDisplayDelegate); | 87 DISALLOW_COPY_AND_ASSIGN(ForwardingDisplayDelegate); |
87 }; | 88 }; |
88 | 89 |
89 } // namespace display | 90 } // namespace display |
90 | 91 |
91 #endif // UI_DISPLAY_MANAGER_FORWARDING_DISPLAY_DELEGATE_H_ | 92 #endif // UI_DISPLAY_MANAGER_FORWARDING_DISPLAY_DELEGATE_H_ |
OLD | NEW |