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

Side by Side Diff: services/ui/ws/display_manager.cc

Issue 2259823003: Re-write many calls to WrapUnique() with MakeUnique() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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/surfaces/display_compositor.cc ('k') | services/ui/ws/frame_generator_unittest.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 #include "services/ui/ws/display_manager.h" 5 #include "services/ui/ws/display_manager.h"
6 6
7 #include "base/memory/ptr_util.h" 7 #include "base/memory/ptr_util.h"
8 #include "services/ui/ws/display.h" 8 #include "services/ui/ws/display.h"
9 #include "services/ui/ws/display_manager_delegate.h" 9 #include "services/ui/ws/display_manager_delegate.h"
10 #include "services/ui/ws/event_dispatcher.h" 10 #include "services/ui/ws/event_dispatcher.h"
(...skipping 18 matching lines...) Expand all
29 29
30 DisplayManager::~DisplayManager() { 30 DisplayManager::~DisplayManager() {
31 user_id_tracker_->RemoveObserver(this); 31 user_id_tracker_->RemoveObserver(this);
32 DestroyAllDisplays(); 32 DestroyAllDisplays();
33 } 33 }
34 34
35 UserDisplayManager* DisplayManager::GetUserDisplayManager( 35 UserDisplayManager* DisplayManager::GetUserDisplayManager(
36 const UserId& user_id) { 36 const UserId& user_id) {
37 if (!user_display_managers_.count(user_id)) { 37 if (!user_display_managers_.count(user_id)) {
38 user_display_managers_[user_id] = 38 user_display_managers_[user_id] =
39 base::WrapUnique(new UserDisplayManager(this, delegate_, user_id)); 39 base::MakeUnique<UserDisplayManager>(this, delegate_, user_id);
40 } 40 }
41 return user_display_managers_[user_id].get(); 41 return user_display_managers_[user_id].get();
42 } 42 }
43 43
44 void DisplayManager::AddDisplay(Display* display) { 44 void DisplayManager::AddDisplay(Display* display) {
45 DCHECK_EQ(0u, pending_displays_.count(display)); 45 DCHECK_EQ(0u, pending_displays_.count(display));
46 pending_displays_.insert(display); 46 pending_displays_.insert(display);
47 } 47 }
48 48
49 void DisplayManager::DestroyDisplay(Display* display) { 49 void DisplayManager::DestroyDisplay(Display* display) {
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 } 150 }
151 151
152 WindowManagerState* current_window_manager_state = 152 WindowManagerState* current_window_manager_state =
153 delegate_->GetWindowManagerStateForUser(active_id); 153 delegate_->GetWindowManagerStateForUser(active_id);
154 if (current_window_manager_state) 154 if (current_window_manager_state)
155 current_window_manager_state->Activate(mouse_location_on_screen); 155 current_window_manager_state->Activate(mouse_location_on_screen);
156 } 156 }
157 157
158 } // namespace ws 158 } // namespace ws
159 } // namespace ui 159 } // namespace ui
OLDNEW
« no previous file with comments | « services/ui/surfaces/display_compositor.cc ('k') | services/ui/ws/frame_generator_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698