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

Unified Diff: ash/mus/screen_mus.cc

Issue 2642003002: Removes ash::mus::RootWindowController (Closed)
Patch Set: feedback Created 3 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: ash/mus/screen_mus.cc
diff --git a/ash/mus/screen_mus.cc b/ash/mus/screen_mus.cc
index f8c15862c0ab17dd8b14dcf8ce7d2f78ff3ba444..260bd952a51c03215c729783b892b8656222ce7c 100644
--- a/ash/mus/screen_mus.cc
+++ b/ash/mus/screen_mus.cc
@@ -4,16 +4,37 @@
#include "ash/mus/screen_mus.h"
+#include "services/ui/public/interfaces/display/display_controller.mojom.h"
#include "ui/aura/env.h"
#include "ui/aura/mus/window_tree_host_mus.h"
#include "ui/aura/window.h"
namespace ash {
-ScreenMus::ScreenMus() = default;
+ScreenMus::ScreenMus(display::mojom::DisplayController* display_controller)
+ : display_controller_(display_controller) {}
ScreenMus::~ScreenMus() = default;
+void ScreenMus::SetWorkAreaInsets(aura::Window* window,
+ const gfx::Insets& insets) {
+ // If we are not the active instance assume we're in shutdown, and ignore.
+ if (display::Screen::GetScreen() != this)
+ return;
+
+ display::Display old_display = GetDisplayNearestWindow(window);
+ display::Display new_display = old_display;
+ new_display.UpdateWorkAreaFromInsets(insets);
+ if (old_display.work_area() == new_display.work_area())
+ return;
+
+ display_list().UpdateDisplay(new_display);
+ if (display_controller_) {
+ display_controller_->SetDisplayWorkArea(
+ new_display.id(), new_display.bounds().size(), insets);
+ }
+}
+
display::Display ScreenMus::GetDisplayNearestWindow(
aura::Window* window) const {
const aura::WindowTreeHost* host = window->GetHost();

Powered by Google App Engine
This is Rietveld 408576698