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

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

Issue 2784173002: Changes how window is updated when display changes in mash (Closed)
Patch Set: cleanup Created 3 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
« no previous file with comments | « no previous file | ash/test/ash_test_helper.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 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 467 matching lines...) Expand 10 before | Expand all | Expand 10 after
478 if (root_window_controller_ptr->GetHost() == window_tree_host) { 478 if (root_window_controller_ptr->GetHost() == window_tree_host) {
479 const bool in_shutdown = false; 479 const bool in_shutdown = false;
480 DestroyRootWindowController(root_window_controller_ptr.get(), 480 DestroyRootWindowController(root_window_controller_ptr.get(),
481 in_shutdown); 481 in_shutdown);
482 break; 482 break;
483 } 483 }
484 } 484 }
485 } 485 }
486 486
487 void WindowManager::OnWmDisplayModified(const display::Display& display) { 487 void WindowManager::OnWmDisplayModified(const display::Display& display) {
488 screen_->display_list().UpdateDisplay(display); 488 // Ash relies on the Display being updated, then the WindowTreeHost's window,
489 // and finally DisplayObservers.
490 std::unique_ptr<display::DisplayListObserverLock> display_lock =
491 screen_->display_list().SuspendObserverUpdates();
492 const bool is_primary =
493 screen_->display_list().FindDisplayById(display.id()) ==
494 screen_->display_list().GetPrimaryDisplayIterator();
495 uint32_t display_changed_values = screen_->display_list().UpdateDisplay(
496 display, is_primary ? display::DisplayList::Type::PRIMARY
497 : display::DisplayList::Type::NOT_PRIMARY);
498 RootWindowController* root_window_controller =
499 WmShellMus::Get()->GetRootWindowControllerWithDisplayId(display.id());
500 DCHECK(root_window_controller);
501 root_window_controller->GetRootWindow()->GetHost()->SetBoundsInPixels(
502 display.bounds());
503 display_lock.reset();
504 for (display::DisplayObserver& observer :
505 *(screen_->display_list().observers())) {
506 observer.OnDisplayMetricsChanged(display, display_changed_values);
507 }
James Cook 2017/03/30 15:34:34 optional: line wrapping in this function might be
sky 2017/03/30 19:04:24 I went with making a local for screen_->display_li
489 } 508 }
490 509
491 void WindowManager::OnWmPerformMoveLoop( 510 void WindowManager::OnWmPerformMoveLoop(
492 aura::Window* window, 511 aura::Window* window,
493 ui::mojom::MoveLoopSource source, 512 ui::mojom::MoveLoopSource source,
494 const gfx::Point& cursor_location, 513 const gfx::Point& cursor_location,
495 const base::Callback<void(bool)>& on_done) { 514 const base::Callback<void(bool)>& on_done) {
496 WmWindow* child_window = WmWindow::Get(window); 515 WmWindow* child_window = WmWindow::Get(window);
497 MoveEventHandler* handler = MoveEventHandler::GetForWindow(child_window); 516 MoveEventHandler* handler = MoveEventHandler::GetForWindow(child_window);
498 if (!handler) { 517 if (!handler) {
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
540 bool WindowManager::IsWindowActive(aura::Window* window) { 559 bool WindowManager::IsWindowActive(aura::Window* window) {
541 return Shell::GetInstance()->activation_client()->GetActiveWindow() == window; 560 return Shell::GetInstance()->activation_client()->GetActiveWindow() == window;
542 } 561 }
543 562
544 void WindowManager::OnWmDeactivateWindow(aura::Window* window) { 563 void WindowManager::OnWmDeactivateWindow(aura::Window* window) {
545 Shell::GetInstance()->activation_client()->DeactivateWindow(window); 564 Shell::GetInstance()->activation_client()->DeactivateWindow(window);
546 } 565 }
547 566
548 } // namespace mus 567 } // namespace mus
549 } // namespace ash 568 } // namespace ash
OLDNEW
« no previous file with comments | « no previous file | ash/test/ash_test_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698