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

Unified Diff: ash/mus/window_manager.cc

Issue 2434923002: Handle modified displays in mustash. (Closed)
Patch Set: Fix PlatformScreenStub for tests. 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/mus/window_manager.h ('k') | services/ui/demo/mus_demo.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/mus/window_manager.cc
diff --git a/ash/mus/window_manager.cc b/ash/mus/window_manager.cc
index b72aa50567abffd463384d88d6714b256d5a3a2e..f02e2c2ed427f6ed0482cf31c69d179fe953e9ee 100644
--- a/ash/mus/window_manager.cc
+++ b/ash/mus/window_manager.cc
@@ -24,6 +24,7 @@
#include "ash/mus/window_manager_observer.h"
#include "ash/public/cpp/shell_window_ids.h"
#include "base/memory/ptr_util.h"
+#include "services/service_manager/public/cpp/connector.h"
#include "services/ui/common/event_matcher_util.h"
#include "services/ui/common/types.h"
#include "services/ui/public/cpp/property_type_converters.h"
@@ -54,6 +55,10 @@ void WindowManager::Init(
DCHECK(!window_tree_client_);
window_tree_client_ = std::move(window_tree_client);
+ // |connector_| will be null in some tests.
+ if (connector_)
+ connector_->ConnectToInterface("service:ui", &display_controller_);
+
screen_ = base::MakeUnique<display::ScreenBase>();
pointer_watcher_event_router_.reset(
@@ -136,6 +141,10 @@ void WindowManager::RemoveObserver(WindowManagerObserver* observer) {
observers_.RemoveObserver(observer);
}
+display::mojom::DisplayController* WindowManager::GetDisplayController() {
+ return display_controller_ ? display_controller_.get() : nullptr;
+}
+
RootWindowController* WindowManager::CreateRootWindowController(
ui::Window* window,
const display::Display& display) {
@@ -333,6 +342,18 @@ void WindowManager::OnWmDisplayRemoved(ui::Window* window) {
DestroyRootWindowController(iter->get());
}
+void WindowManager::OnWmDisplayModified(const display::Display& display) {
+ for (auto& controller : root_window_controllers_) {
+ if (controller->display().id() == display.id()) {
+ controller->SetDisplay(display);
+ // The root window will be resized by the window server.
+ return;
+ }
+ }
+
+ NOTREACHED();
+}
+
void WindowManager::OnWmPerformMoveLoop(
ui::Window* window,
ui::mojom::MoveLoopSource source,
« no previous file with comments | « ash/mus/window_manager.h ('k') | services/ui/demo/mus_demo.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698