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

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

Issue 2652713003: aura-mus: Make StackAtTop() proxy to the window manager. (Closed)
Patch Set: Add explicit bails in WmStackAtTop. 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') | no next file » | 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 d5cef1fae1c448b7cc621187bf7ab32de56a5eb9..150ea7a40ceeb18db1243d0ce63e7a0827e58ba2 100644
--- a/ui/aura/mus/window_tree_client.cc
+++ b/ui/aura/mus/window_tree_client.cc
@@ -1325,6 +1325,15 @@ void WindowTreeClient::OnChangeCompleted(uint32_t change_id, bool success) {
on_current_move_finished_.Run(success);
on_current_move_finished_.Reset();
}
+
+ // Look for a corresponding window manager change in the
+ if (window_manager_internal_client_) {
+ auto it = in_flight_change_map_.find(change_id);
+ if (it != in_flight_change_map_.end()) {
+ window_manager_internal_client_->WmResponse(it->second, success);
+ in_flight_change_map_.erase(it);
+ }
+ }
}
void WindowTreeClient::GetWindowManager(
@@ -1510,6 +1519,34 @@ void WindowTreeClient::WmDeactivateWindow(Id window_id) {
window_manager_delegate_->OnWmDeactivateWindow(window->GetWindow());
}
+void WindowTreeClient::WmStackAtTop(uint32_t wm_change_id, uint32_t window_id) {
+ WindowMus* window = GetWindowByServerId(window_id);
sky 2017/01/24 17:18:23 I think you want almost the same logic here as is
+ if (!window) {
+ DVLOG(1) << "Attempt to stack at top invalid window " << window_id;
+ if (window_manager_internal_client_)
+ window_manager_internal_client_->WmResponse(wm_change_id, false);
+ return;
+ }
+
+ Window* parent = window->GetWindow()->parent();
+ WindowMus* relative_window = WindowMus::Get(parent->children().back());
+ if (relative_window == window) {
+ DVLOG(3) << "WmStackAtTop ignored (already at top)";
+ if (window_manager_internal_client_)
+ window_manager_internal_client_->WmResponse(wm_change_id, true);
+ return;
+ }
+
+ const uint32_t client_change_id = ScheduleInFlightChange(
+ base::MakeUnique<CrashInFlightChange>(WindowMus::Get(parent),
+ ChangeType::REORDER));
+ in_flight_change_map_.insert(std::make_pair(client_change_id, wm_change_id));
+ tree_->ReorderWindow(client_change_id,
+ window->server_id(),
+ relative_window->server_id(),
+ ui::mojom::OrderDirection::ABOVE);
+}
+
void WindowTreeClient::OnAccelerator(uint32_t ack_id,
uint32_t accelerator_id,
std::unique_ptr<ui::Event> event) {
« no previous file with comments | « ui/aura/mus/window_tree_client.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698