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

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

Issue 2310133002: Add mojom::DisplayController. (Closed)
Patch Set: Add missing dep. Created 4 years, 3 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.h ('k') | services/ui/ws/platform_display.h » ('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/display/platform_screen.h" 8 #include "services/ui/display/platform_screen.h"
9 #include "services/ui/ws/display.h" 9 #include "services/ui/ws/display.h"
10 #include "services/ui/ws/display_binding.h" 10 #include "services/ui/ws/display_binding.h"
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 ->mouse_pointer_last_location(); 160 ->mouse_pointer_last_location();
161 previous_window_manager_state->Deactivate(); 161 previous_window_manager_state->Deactivate();
162 } 162 }
163 163
164 WindowManagerState* current_window_manager_state = 164 WindowManagerState* current_window_manager_state =
165 window_server_->GetWindowManagerStateForUser(active_id); 165 window_server_->GetWindowManagerStateForUser(active_id);
166 if (current_window_manager_state) 166 if (current_window_manager_state)
167 current_window_manager_state->Activate(mouse_location_on_screen); 167 current_window_manager_state->Activate(mouse_location_on_screen);
168 } 168 }
169 169
170 void DisplayManager::OnDisplayAdded(display::PlatformScreen* platform_screen, 170 void DisplayManager::OnDisplayAdded(int64_t id, const gfx::Rect& bounds) {
171 int64_t id,
172 const gfx::Rect& bounds) {
173 PlatformDisplayInitParams params; 171 PlatformDisplayInitParams params;
174 params.display_bounds = bounds; 172 params.display_bounds = bounds;
175 params.display_id = id; 173 params.display_id = id;
176 params.platform_screen = platform_screen;
177 params.surfaces_state = window_server_->GetSurfacesState(); 174 params.surfaces_state = window_server_->GetSurfacesState();
178 175
179 ws::Display* display = new ws::Display(window_server_, params); 176 ws::Display* display = new ws::Display(window_server_, params);
180 display->Init(nullptr); 177 display->Init(nullptr);
181 178
182 window_server_->delegate()->UpdateTouchTransforms(); 179 window_server_->delegate()->UpdateTouchTransforms();
183 } 180 }
184 181
185 void DisplayManager::OnDisplayRemoved(int64_t id) { 182 void DisplayManager::OnDisplayRemoved(int64_t id) {
186 Display* display = GetDisplayById(id); 183 Display* display = GetDisplayById(id);
187 if (display) 184 if (display)
188 DestroyDisplay(display); 185 DestroyDisplay(display);
189 // TODO(kylechar): What if the display is still pending? 186 // TODO(kylechar): What if the display is still pending?
190 } 187 }
191 188
192 void DisplayManager::OnDisplayModified(int64_t id, const gfx::Rect& bounds) { 189 void DisplayManager::OnDisplayModified(int64_t id, const gfx::Rect& bounds) {
193 // TODO(kylechar): Implement. 190 // TODO(kylechar): Implement.
194 NOTREACHED(); 191 NOTREACHED();
195 } 192 }
196 193
197 } // namespace ws 194 } // namespace ws
198 } // namespace ui 195 } // namespace ui
OLDNEW
« no previous file with comments | « services/ui/ws/display_manager.h ('k') | services/ui/ws/platform_display.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698