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

Side by Side Diff: components/mus/ws/window_manager_state.h

Issue 1906623003: Convert //components/mus from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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
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 COMPONENTS_MUS_WS_WINDOW_MANAGER_STATE_H_ 5 #ifndef COMPONENTS_MUS_WS_WINDOW_MANAGER_STATE_H_
6 #define COMPONENTS_MUS_WS_WINDOW_MANAGER_STATE_H_ 6 #define COMPONENTS_MUS_WS_WINDOW_MANAGER_STATE_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include "base/memory/scoped_ptr.h" 10 #include <memory>
11
11 #include "base/memory/weak_ptr.h" 12 #include "base/memory/weak_ptr.h"
12 #include "base/timer/timer.h" 13 #include "base/timer/timer.h"
13 #include "components/mus/public/interfaces/display.mojom.h" 14 #include "components/mus/public/interfaces/display.mojom.h"
14 #include "components/mus/ws/event_dispatcher.h" 15 #include "components/mus/ws/event_dispatcher.h"
15 #include "components/mus/ws/event_dispatcher_delegate.h" 16 #include "components/mus/ws/event_dispatcher_delegate.h"
16 #include "components/mus/ws/user_id.h" 17 #include "components/mus/ws/user_id.h"
17 #include "components/mus/ws/window_server.h" 18 #include "components/mus/ws/window_server.h"
18 19
19 namespace cc { 20 namespace cc {
20 struct SurfaceId; 21 struct SurfaceId;
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 // . We get an event from the PlatformDisplay. This results in |event| being 117 // . We get an event from the PlatformDisplay. This results in |event| being
117 // set, but |processed_target| is null. 118 // set, but |processed_target| is null.
118 // . We get an event from the EventDispatcher. In this case both |event| and 119 // . We get an event from the EventDispatcher. In this case both |event| and
119 // |processed_target| are valid. 120 // |processed_target| are valid.
120 // The second case happens if EventDispatcher generates more than one event 121 // The second case happens if EventDispatcher generates more than one event
121 // at a time. 122 // at a time.
122 struct QueuedEvent { 123 struct QueuedEvent {
123 QueuedEvent(); 124 QueuedEvent();
124 ~QueuedEvent(); 125 ~QueuedEvent();
125 126
126 scoped_ptr<ui::Event> event; 127 std::unique_ptr<ui::Event> event;
127 scoped_ptr<ProcessedEventTarget> processed_target; 128 std::unique_ptr<ProcessedEventTarget> processed_target;
128 }; 129 };
129 130
130 WindowManagerState(Display* display, 131 WindowManagerState(Display* display,
131 PlatformDisplay* platform_display, 132 PlatformDisplay* platform_display,
132 cc::SurfaceId surface_id, 133 cc::SurfaceId surface_id,
133 bool is_user_id_valid, 134 bool is_user_id_valid,
134 const UserId& user_id); 135 const UserId& user_id);
135 136
136 WindowServer* window_server(); 137 WindowServer* window_server();
137 138
138 void OnEventAckTimeout(); 139 void OnEventAckTimeout();
139 140
140 // Schedules an event to be processed later. 141 // Schedules an event to be processed later.
141 void QueueEvent(const ui::Event& event, 142 void QueueEvent(const ui::Event& event,
142 scoped_ptr<ProcessedEventTarget> processed_event_target); 143 std::unique_ptr<ProcessedEventTarget> processed_event_target);
143 144
144 // Processes the next valid event in |event_queue_|. If the event has already 145 // Processes the next valid event in |event_queue_|. If the event has already
145 // been processed it is dispatched, otherwise the event is passed to the 146 // been processed it is dispatched, otherwise the event is passed to the
146 // EventDispatcher for processing. 147 // EventDispatcher for processing.
147 void ProcessNextEventFromQueue(); 148 void ProcessNextEventFromQueue();
148 149
149 // Dispatches the event to the appropriate client and starts the ack timer. 150 // Dispatches the event to the appropriate client and starts the ack timer.
150 void DispatchInputEventToWindowImpl(ServerWindow* target, 151 void DispatchInputEventToWindowImpl(ServerWindow* target,
151 bool in_nonclient_area, 152 bool in_nonclient_area,
152 const ui::Event& event, 153 const ui::Event& event,
(...skipping 13 matching lines...) Expand all
166 167
167 Display* display_; 168 Display* display_;
168 PlatformDisplay* platform_display_; 169 PlatformDisplay* platform_display_;
169 // If this was created implicitly by a call 170 // If this was created implicitly by a call
170 // WindowTreeHostFactory::CreateWindowTreeHost(), then |is_user_id_valid_| 171 // WindowTreeHostFactory::CreateWindowTreeHost(), then |is_user_id_valid_|
171 // is false. 172 // is false.
172 const bool is_user_id_valid_; 173 const bool is_user_id_valid_;
173 const UserId user_id_; 174 const UserId user_id_;
174 // Root ServerWindow of this WindowManagerState. |root_| has a parent, the 175 // Root ServerWindow of this WindowManagerState. |root_| has a parent, the
175 // root ServerWindow of the Display. 176 // root ServerWindow of the Display.
176 scoped_ptr<ServerWindow> root_; 177 std::unique_ptr<ServerWindow> root_;
177 WindowTree* tree_ = nullptr; 178 WindowTree* tree_ = nullptr;
178 179
179 // Set to true the first time SetFrameDecorationValues() is received. 180 // Set to true the first time SetFrameDecorationValues() is received.
180 bool got_frame_decoration_values_ = false; 181 bool got_frame_decoration_values_ = false;
181 mojom::FrameDecorationValuesPtr frame_decoration_values_; 182 mojom::FrameDecorationValuesPtr frame_decoration_values_;
182 183
183 mojom::WindowTree* tree_awaiting_input_ack_ = nullptr; 184 mojom::WindowTree* tree_awaiting_input_ack_ = nullptr;
184 scoped_ptr<ui::Event> event_awaiting_input_ack_; 185 std::unique_ptr<ui::Event> event_awaiting_input_ack_;
185 base::WeakPtr<Accelerator> post_target_accelerator_; 186 base::WeakPtr<Accelerator> post_target_accelerator_;
186 std::queue<scoped_ptr<QueuedEvent>> event_queue_; 187 std::queue<std::unique_ptr<QueuedEvent>> event_queue_;
187 base::OneShotTimer event_ack_timer_; 188 base::OneShotTimer event_ack_timer_;
188 189
189 EventDispatcher event_dispatcher_; 190 EventDispatcher event_dispatcher_;
190 191
191 DISALLOW_COPY_AND_ASSIGN(WindowManagerState); 192 DISALLOW_COPY_AND_ASSIGN(WindowManagerState);
192 }; 193 };
193 194
194 } // namespace ws 195 } // namespace ws
195 } // namespace mus 196 } // namespace mus
196 197
197 #endif // COMPONENTS_MUS_WS_WINDOW_MANAGER_STATE_H_ 198 #endif // COMPONENTS_MUS_WS_WINDOW_MANAGER_STATE_H_
OLDNEW
« no previous file with comments | « components/mus/ws/window_manager_factory_registry.cc ('k') | components/mus/ws/window_manager_state.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698