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

Unified Diff: services/ui/ws/window_server.cc

Issue 2712203002: c++ / mojo changes for 'external window mode'
Patch Set: rebased Created 3 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 | « services/ui/ws/window_server.h ('k') | services/ui/ws/window_tree.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/ui/ws/window_server.cc
diff --git a/services/ui/ws/window_server.cc b/services/ui/ws/window_server.cc
index a1a67187ffb9ada208d3a6b522edd8f6c0aed92e..b7864006819e66d98a91c8ccd701ecf735e997fb 100644
--- a/services/ui/ws/window_server.cc
+++ b/services/ui/ws/window_server.cc
@@ -193,6 +193,12 @@ WindowTree* WindowServer::GetTreeWithClientName(
return nullptr;
}
+WindowTree* WindowServer::GetTreeForExternalWindowMode() {
+ DCHECK_LE(1u, tree_map_.size());
+ DCHECK(IsInExternalWindowMode());
+ return tree_map_.begin()->second.get();
+}
+
ServerWindow* WindowServer::GetWindow(const WindowId& id) {
// kInvalidClientId is used for Display and WindowManager nodes.
if (id.client_id == kInvalidClientId) {
@@ -579,7 +585,7 @@ void WindowServer::FinishOperation() {
void WindowServer::UpdateNativeCursorFromMouseLocation(ServerWindow* window) {
WindowManagerDisplayRoot* display_root =
display_manager_->GetWindowManagerDisplayRoot(window);
- if (display_root) {
+ if (display_root && display_root->window_manager_state()) {
EventDispatcher* event_dispatcher =
display_root->window_manager_state()->event_dispatcher();
event_dispatcher->UpdateCursorProviderByLastKnownLocation();
@@ -591,7 +597,7 @@ void WindowServer::UpdateNativeCursorFromMouseLocation(ServerWindow* window) {
void WindowServer::UpdateNativeCursorIfOver(ServerWindow* window) {
WindowManagerDisplayRoot* display_root =
display_manager_->GetWindowManagerDisplayRoot(window);
- if (!display_root)
+ if (!display_root || !display_root->window_manager_state())
return;
EventDispatcher* event_dispatcher =
@@ -665,7 +671,7 @@ void WindowServer::OnWindowHierarchyChanged(ServerWindow* window,
WindowManagerDisplayRoot* display_root =
display_manager_->GetWindowManagerDisplayRoot(window);
- if (display_root)
+ if (display_root && display_root->window_manager_state())
display_root->window_manager_state()
->ReleaseCaptureBlockedByAnyModalWindow();
@@ -744,7 +750,7 @@ void WindowServer::OnWindowVisibilityChanged(ServerWindow* window) {
WindowManagerDisplayRoot* display_root =
display_manager_->GetWindowManagerDisplayRoot(window);
- if (display_root)
+ if (display_root && display_root->window_manager_state())
display_root->window_manager_state()->ReleaseCaptureBlockedByModalWindow(
window);
}
« no previous file with comments | « services/ui/ws/window_server.h ('k') | services/ui/ws/window_tree.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698