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

Unified Diff: components/mus/ws/window_tree.cc

Issue 1775583002: Moves FrameDecorations from Display to WindowManagerState (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: override Created 4 years, 9 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 | « components/mus/ws/window_tree.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/mus/ws/window_tree.cc
diff --git a/components/mus/ws/window_tree.cc b/components/mus/ws/window_tree.cc
index 8d902d3a3d71d17eb2ad4bc12726f57a8e50dacf..7782e8b30fecbc69df847ec8797d0ca23621d9b2 100644
--- a/components/mus/ws/window_tree.cc
+++ b/components/mus/ws/window_tree.cc
@@ -573,19 +573,22 @@ const DisplayManager* WindowTree::display_manager() const {
}
Display* WindowTree::GetDisplayForWindowManager() {
+ return GetWindowManagerStateForWindowManager()->display();
+}
+
+WindowManagerState* WindowTree::GetWindowManagerStateForWindowManager() {
// The WindowTree for the wm has one and only one root.
CHECK_EQ(1u, roots_.size());
// Indicates this connection is for the wm.
DCHECK(window_manager_internal_);
- Display* display = GetDisplay(*roots_.begin());
- WindowManagerAndDisplay wm_and_display =
- display_manager()->GetWindowManagerAndDisplay(*roots_.begin());
- CHECK(wm_and_display.display);
- CHECK(wm_and_display.window_manager_state);
- DCHECK_EQ(this, wm_and_display.window_manager_state->tree());
- return display;
+ WindowManagerState* wms = display_manager()
+ ->GetWindowManagerAndDisplay(*roots_.begin())
+ .window_manager_state;
+ CHECK(wms);
+ DCHECK_EQ(this, wms->tree());
+ return wms;
}
bool WindowTree::ShouldRouteToWindowManager(const ServerWindow* window) const {
@@ -1327,8 +1330,9 @@ void WindowTree::WmRequestClose(Id transport_window_id) {
void WindowTree::WmSetFrameDecorationValues(
mojom::FrameDecorationValuesPtr values) {
- if (GetDisplayForWindowManager())
- GetDisplayForWindowManager()->SetFrameDecorationValues(std::move(values));
+ WindowManagerState* wm_state = GetWindowManagerStateForWindowManager();
+ if (wm_state)
+ wm_state->SetFrameDecorationValues(std::move(values));
}
void WindowTree::OnWmCreatedTopLevelWindow(uint32_t change_id,
« no previous file with comments | « components/mus/ws/window_tree.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698