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

Unified Diff: ui/aura/mus/window_tree_client.cc

Issue 2604453002: Fix WindowTreeClient::RequestClose(window_id). (Closed)
Patch Set: test 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
« no previous file with comments | « no previous file | ui/aura/mus/window_tree_client_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/aura/mus/window_tree_client.cc
diff --git a/ui/aura/mus/window_tree_client.cc b/ui/aura/mus/window_tree_client.cc
index e9d1c0772d7a3ed3e42a9dae278a8516cec18268..0335352ed9e8e0e5c27d48669c2aa0a05f2d6a9b 100644
--- a/ui/aura/mus/window_tree_client.cc
+++ b/ui/aura/mus/window_tree_client.cc
@@ -1311,10 +1311,16 @@ void WindowTreeClient::GetWindowManager(
void WindowTreeClient::RequestClose(uint32_t window_id) {
WindowMus* window = GetWindowByServerId(window_id);
- if (!window || !IsRoot(window))
+ if (!window)
return;
- window->GetWindow()->delegate()->OnRequestClose();
+ // If the window is the root window, we send close request to the entire
+ // WindowTreeHost. Otherwise we ask the delegate of the window to close it.
+ if (IsRoot(window)) {
+ GetWindowTreeHostMus(window->GetWindow())->OnCloseRequest();
+ } else {
+ window->GetWindow()->delegate()->OnRequestClose();
+ }
sadrul 2017/01/04 20:08:07 Don't need {} As discussed offline, the alternate
}
void WindowTreeClient::OnConnect(ClientSpecificId client_id) {
« no previous file with comments | « no previous file | ui/aura/mus/window_tree_client_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698