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

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

Issue 2655463009: aura-mus: Implement DesktopWindowTreeHostMus::StackAbove(). (Closed)
Patch Set: Add comment. 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 | « ui/aura/mus/window_tree_client.h ('k') | ui/aura/mus/window_tree_host_mus.h » ('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 0ae7b855248f0aec78dd4bf89bc0c5cdef6ea326..2c22cb46b6e0bbb51164e6501d08c7bc71d076ce 100644
--- a/ui/aura/mus/window_tree_client.cc
+++ b/ui/aura/mus/window_tree_client.cc
@@ -1510,6 +1510,43 @@ void WindowTreeClient::WmDeactivateWindow(Id window_id) {
window_manager_delegate_->OnWmDeactivateWindow(window->GetWindow());
}
+void WindowTreeClient::WmStackAbove(uint32_t wm_change_id, Id above_id,
+ Id below_id) {
+ if (!window_manager_delegate_)
+ return;
+
+ WindowMus* below_mus = GetWindowByServerId(below_id);
+ if (!below_mus) {
+ DVLOG(1) << "Attempt to stack at top invalid window " << below_id;
+ if (window_manager_internal_client_)
+ window_manager_internal_client_->WmResponse(wm_change_id, false);
+ return;
+ }
+
+ WindowMus* above_mus = GetWindowByServerId(above_id);
+ if (!above_mus) {
+ DVLOG(1) << "Attempt to stack at top invalid window " << above_id;
+ if (window_manager_internal_client_)
+ window_manager_internal_client_->WmResponse(wm_change_id, false);
+ return;
+ }
+
+ Window* above = above_mus->GetWindow();
+ Window* below = below_mus->GetWindow();
+
+ if (above->parent() != below->parent()) {
+ DVLOG(1) << "Windows do not share the same parent";
+ if (window_manager_internal_client_)
+ window_manager_internal_client_->WmResponse(wm_change_id, false);
+ return;
+ }
+
+ above->parent()->StackChildAbove(above, below);
+
+ if (window_manager_internal_client_)
+ window_manager_internal_client_->WmResponse(wm_change_id, true);
+}
+
void WindowTreeClient::WmStackAtTop(uint32_t wm_change_id, uint32_t window_id) {
if (!window_manager_delegate_)
return;
@@ -1655,6 +1692,16 @@ void WindowTreeClient::OnWindowTreeHostDeactivateWindow(
WindowMus::Get(window_tree_host->window())->server_id());
}
+void WindowTreeClient::OnWindowTreeHostStackAbove(
+ WindowTreeHostMus* window_tree_host,
+ Window* window) {
+ WindowMus* above = WindowMus::Get(window_tree_host->window());
+ WindowMus* below = WindowMus::Get(window);
+ const uint32_t change_id = ScheduleInFlightChange(
+ base::MakeUnique<CrashInFlightChange>(above, ChangeType::REORDER));
+ tree_->StackAbove(change_id, above->server_id(), below->server_id());
+}
+
void WindowTreeClient::OnWindowTreeHostStackAtTop(
WindowTreeHostMus* window_tree_host) {
WindowMus* window = WindowMus::Get(window_tree_host->window());
« no previous file with comments | « ui/aura/mus/window_tree_client.h ('k') | ui/aura/mus/window_tree_host_mus.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698