Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(170)

Side by Side Diff: services/ui/ws/user_display_manager.h

Issue 2904993003: chromeos: changes how DisplayManagerObservers are notified (Closed)
Patch Set: cleanup Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « services/ui/ws/test_utils.cc ('k') | services/ui/ws/user_display_manager.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 SERVICES_UI_WS_USER_DISPLAY_MANAGER_H_ 5 #ifndef SERVICES_UI_WS_USER_DISPLAY_MANAGER_H_
6 #define SERVICES_UI_WS_USER_DISPLAY_MANAGER_H_ 6 #define SERVICES_UI_WS_USER_DISPLAY_MANAGER_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 11 matching lines...) Expand all
22 22
23 class UserDisplayManagerDelegate; 23 class UserDisplayManagerDelegate;
24 24
25 // Provides per user display state. 25 // Provides per user display state.
26 class UserDisplayManager : public mojom::DisplayManager { 26 class UserDisplayManager : public mojom::DisplayManager {
27 public: 27 public:
28 UserDisplayManager(UserDisplayManagerDelegate* delegate, 28 UserDisplayManager(UserDisplayManagerDelegate* delegate,
29 const UserId& user_id); 29 const UserId& user_id);
30 ~UserDisplayManager() override; 30 ~UserDisplayManager() override;
31 31
32 void DisableAutomaticNotification();
33
34 // Unconditionally calls OnDisplayChanged() on observers.
35 void CallOnDisplaysChanged();
36
32 // Called when the frame decorations for this user change. 37 // Called when the frame decorations for this user change.
33 void OnFrameDecorationValuesChanged(); 38 void OnFrameDecorationValuesChanged();
34 39
35 void AddDisplayManagerBinding( 40 void AddDisplayManagerBinding(
36 mojo::InterfaceRequest<mojom::DisplayManager> request); 41 mojo::InterfaceRequest<mojom::DisplayManager> request);
37 42
38 // Called when something about the display (e.g. pixel-ratio, size) changes. 43 // Called when something about the display (e.g. pixel-ratio, size) changes.
39 void OnDisplayUpdated(const display::Display& display); 44 void OnDisplayUpdated(const display::Display& display);
40 45
41 // Called when the display with |display_id| was removed. 46 // Called when the display with |display_id| was removed.
(...skipping 29 matching lines...) Expand all
71 76
72 // Set to true the first time at least one Display has valid frame values. 77 // Set to true the first time at least one Display has valid frame values.
73 bool got_valid_frame_decorations_; 78 bool got_valid_frame_decorations_;
74 79
75 mojo::BindingSet<mojom::DisplayManager> display_manager_bindings_; 80 mojo::BindingSet<mojom::DisplayManager> display_manager_bindings_;
76 81
77 // WARNING: only use these once |got_valid_frame_decorations_| is true. 82 // WARNING: only use these once |got_valid_frame_decorations_| is true.
78 mojo::InterfacePtrSet<mojom::DisplayManagerObserver> 83 mojo::InterfacePtrSet<mojom::DisplayManagerObserver>
79 display_manager_observers_; 84 display_manager_observers_;
80 85
86 // If true DisplayManagerObservers are notified any time there is a display
87 // change. If false, observers are only notified when CallOnDisplaysChanged()
88 // is explicitly called. This value is true in automatic display creation and
89 // false when in manual mode.
90 bool notify_automatically_ = true;
91
81 DISALLOW_COPY_AND_ASSIGN(UserDisplayManager); 92 DISALLOW_COPY_AND_ASSIGN(UserDisplayManager);
82 }; 93 };
83 94
84 } // namespace ws 95 } // namespace ws
85 } // namespace ui 96 } // namespace ui
86 97
87 #endif // SERVICES_UI_WS_USER_DISPLAY_MANAGER_H_ 98 #endif // SERVICES_UI_WS_USER_DISPLAY_MANAGER_H_
OLDNEW
« no previous file with comments | « services/ui/ws/test_utils.cc ('k') | services/ui/ws/user_display_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698