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

Side by Side Diff: ash/mus/window_manager.cc

Issue 2434923002: Handle modified displays in mustash. (Closed)
Patch Set: Fixes after initial review. Created 4 years, 2 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "ash/mus/window_manager.h" 5 #include "ash/mus/window_manager.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <utility> 9 #include <utility>
10 10
(...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after
326 const display::Display& display) { 326 const display::Display& display) {
327 CreateRootWindowController(window, display); 327 CreateRootWindowController(window, display);
328 } 328 }
329 329
330 void WindowManager::OnWmDisplayRemoved(ui::Window* window) { 330 void WindowManager::OnWmDisplayRemoved(ui::Window* window) {
331 auto iter = FindRootWindowControllerByWindow(window); 331 auto iter = FindRootWindowControllerByWindow(window);
332 DCHECK(iter != root_window_controllers_.end()); 332 DCHECK(iter != root_window_controllers_.end());
333 DestroyRootWindowController(iter->get()); 333 DestroyRootWindowController(iter->get());
334 } 334 }
335 335
336 void WindowManager::OnWmDisplayModified(const display::Display& display) {
337 for (auto& controller : root_window_controllers_) {
338 if (controller->display().id() == display.id()) {
339 controller->set_display(display);
sky 2016/10/19 23:37:59 Can you make set_display() call to UpdateDisplay()
kylechar 2016/10/20 15:04:19 I could do that. In general it seems wrong to me t
sky 2016/10/20 15:33:24 Good point. I would still think RootWindowControll
kylechar 2016/10/20 18:31:29 Done.
340 screen_->display_list()->UpdateDisplay(display);
341 // The root window will be resized by the window server.
342 return;
343 }
344 }
345
346 NOTREACHED();
347 }
348
336 void WindowManager::OnWmPerformMoveLoop( 349 void WindowManager::OnWmPerformMoveLoop(
337 ui::Window* window, 350 ui::Window* window,
338 ui::mojom::MoveLoopSource source, 351 ui::mojom::MoveLoopSource source,
339 const gfx::Point& cursor_location, 352 const gfx::Point& cursor_location,
340 const base::Callback<void(bool)>& on_done) { 353 const base::Callback<void(bool)>& on_done) {
341 WmWindowMus* child_window = WmWindowMus::Get(window); 354 WmWindowMus* child_window = WmWindowMus::Get(window);
342 MoveEventHandler* handler = MoveEventHandler::GetForWindow(child_window); 355 MoveEventHandler* handler = MoveEventHandler::GetForWindow(child_window);
343 if (!handler) { 356 if (!handler) {
344 on_done.Run(false); 357 on_done.Run(false);
345 return; 358 return;
(...skipping 18 matching lines...) Expand all
364 const ui::Event& event) { 377 const ui::Event& event) {
365 auto iter = accelerator_handlers_.find(GetAcceleratorNamespaceId(id)); 378 auto iter = accelerator_handlers_.find(GetAcceleratorNamespaceId(id));
366 if (iter == accelerator_handlers_.end()) 379 if (iter == accelerator_handlers_.end())
367 return ui::mojom::EventResult::HANDLED; 380 return ui::mojom::EventResult::HANDLED;
368 381
369 return iter->second->OnAccelerator(id, event); 382 return iter->second->OnAccelerator(id, event);
370 } 383 }
371 384
372 } // namespace mus 385 } // namespace mus
373 } // namespace ash 386 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698