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

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

Issue 2897303002: chromeos: Changes DisplayManagerObserver to have a single function (Closed)
Patch Set: fix compile Created 3 years, 7 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/display_manager.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 18 matching lines...) Expand all
29 const UserId& user_id); 29 const UserId& user_id);
30 ~UserDisplayManager() override; 30 ~UserDisplayManager() override;
31 31
32 // Called when the frame decorations for this user change. 32 // Called when the frame decorations for this user change.
33 void OnFrameDecorationValuesChanged(); 33 void OnFrameDecorationValuesChanged();
34 34
35 void AddDisplayManagerBinding( 35 void AddDisplayManagerBinding(
36 mojo::InterfaceRequest<mojom::DisplayManager> request); 36 mojo::InterfaceRequest<mojom::DisplayManager> request);
37 37
38 // Called when something about the display (e.g. pixel-ratio, size) changes. 38 // Called when something about the display (e.g. pixel-ratio, size) changes.
39 void OnDisplayUpdate(const display::Display& display); 39 void OnDisplayUpdated(const display::Display& display);
40 40
41 // Called when |display_id| is being removed. 41 // Called when the display with |display_id| was removed.
42 void OnWillDestroyDisplay(int64_t display_id); 42 void OnDisplayDestroyed(int64_t display_id);
43 43
44 // Called when the primary display changes. 44 // Called when the primary display changes.
45 void OnPrimaryDisplayChanged(int64_t primary_display_id); 45 void OnPrimaryDisplayChanged(int64_t primary_display_id);
46 46
47 // Overriden from mojom::DisplayManager: 47 // Overriden from mojom::DisplayManager:
48 void AddObserver(mojom::DisplayManagerObserverPtr observer) override; 48 void AddObserver(mojom::DisplayManagerObserverPtr observer) override;
49 49
50 private: 50 private:
51 // Called when a new observer is added. If frame decorations are available 51 // Called when a new observer is added. If frame decorations are available
52 // notifies the observer immediately. 52 // notifies the observer immediately.
53 void OnObserverAdded(mojom::DisplayManagerObserver* observer); 53 void OnObserverAdded(mojom::DisplayManagerObserver* observer);
54 54
55 // Fills in a WsDisplayPtr for |display|. 55 // Fills in a WsDisplayPtr for |display|.
56 mojom::WsDisplayPtr ToWsDisplayPtr(const display::Display& display); 56 mojom::WsDisplayPtr ToWsDisplayPtr(const display::Display& display);
57 57
58 std::vector<mojom::WsDisplayPtr> GetAllDisplays(); 58 std::vector<mojom::WsDisplayPtr> GetAllDisplays();
59 59
60 // Calls OnDisplays() on |observer|. 60 bool ShouldCallOnDisplaysChanged() const;
61 void CallOnDisplays(mojom::DisplayManagerObserver* observer); 61
62 // Calls OnDisplaysChanged() on all observers.
63 void CallOnDisplaysChangedIfNecessary();
64
65 // Calls OnDisplaysChanged() on |observer|.
66 void CallOnDisplaysChanged(mojom::DisplayManagerObserver* observer);
62 67
63 UserDisplayManagerDelegate* delegate_; 68 UserDisplayManagerDelegate* delegate_;
64 69
65 const UserId user_id_; 70 const UserId user_id_;
66 71
67 // Set to true the first time at least one Display has valid frame values. 72 // Set to true the first time at least one Display has valid frame values.
68 bool got_valid_frame_decorations_; 73 bool got_valid_frame_decorations_;
69 74
70 mojo::BindingSet<mojom::DisplayManager> display_manager_bindings_; 75 mojo::BindingSet<mojom::DisplayManager> display_manager_bindings_;
71 76
72 // WARNING: only use these once |got_valid_frame_decorations_| is true. 77 // WARNING: only use these once |got_valid_frame_decorations_| is true.
73 mojo::InterfacePtrSet<mojom::DisplayManagerObserver> 78 mojo::InterfacePtrSet<mojom::DisplayManagerObserver>
74 display_manager_observers_; 79 display_manager_observers_;
75 80
76 DISALLOW_COPY_AND_ASSIGN(UserDisplayManager); 81 DISALLOW_COPY_AND_ASSIGN(UserDisplayManager);
77 }; 82 };
78 83
79 } // namespace ws 84 } // namespace ws
80 } // namespace ui 85 } // namespace ui
81 86
82 #endif // SERVICES_UI_WS_USER_DISPLAY_MANAGER_H_ 87 #endif // SERVICES_UI_WS_USER_DISPLAY_MANAGER_H_
OLDNEW
« no previous file with comments | « services/ui/ws/display_manager.cc ('k') | services/ui/ws/user_display_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698