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

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

Issue 2633233003: aura-mus: Implement stacking in DesktopWindowTreeHostMus. (Closed)
Patch Set: Reword 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_client_test_observer.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 07a960e7143d90dec90484f56ce54c89a7693a1a..d5cef1fae1c448b7cc621187bf7ab32de56a5eb9 100644
--- a/ui/aura/mus/window_tree_client.cc
+++ b/ui/aura/mus/window_tree_client.cc
@@ -38,6 +38,7 @@
#include "ui/aura/mus/window_port_mus.h"
#include "ui/aura/mus/window_tree_client_delegate.h"
#include "ui/aura/mus/window_tree_client_observer.h"
+#include "ui/aura/mus/window_tree_client_test_observer.h"
#include "ui/aura/mus/window_tree_host_mus.h"
#include "ui/aura/window.h"
#include "ui/aura/window_delegate.h"
@@ -327,8 +328,11 @@ uint32_t WindowTreeClient::ScheduleInFlightChange(
std::unique_ptr<InFlightChange> change) {
DCHECK(!change->window() ||
windows_.count(change->window()->server_id()) > 0);
+ ChangeType t = change->change_type();
const uint32_t change_id = next_change_id_++;
in_flight_map_[change_id] = std::move(change);
+ for (auto& observer : test_observers_)
+ observer.OnChangeStarted(change_id, t);
return change_id;
}
@@ -833,6 +837,15 @@ void WindowTreeClient::RemoveObserver(WindowTreeClientObserver* observer) {
observers_.RemoveObserver(observer);
}
+void WindowTreeClient::AddTestObserver(WindowTreeClientTestObserver* observer) {
+ test_observers_.AddObserver(observer);
+}
+
+void WindowTreeClient::RemoveTestObserver(
+ WindowTreeClientTestObserver* observer) {
+ test_observers_.RemoveObserver(observer);
+}
+
void WindowTreeClient::SetCanAcceptDrops(Id window_id, bool can_accept_drops) {
DCHECK(tree_);
tree_->SetCanAcceptDrops(window_id, can_accept_drops);
@@ -1293,6 +1306,9 @@ void WindowTreeClient::OnChangeCompleted(uint32_t change_id, bool success) {
if (!change)
return;
+ for (auto& observer : test_observers_)
+ observer.OnChangeCompleted(change_id, change->change_type(), success);
+
if (!success)
change->ChangeFailed();
@@ -1620,6 +1636,14 @@ void WindowTreeClient::OnWindowTreeHostDeactivateWindow(
WindowMus::Get(window_tree_host->window())->server_id());
}
+void WindowTreeClient::OnWindowTreeHostStackAtTop(
+ WindowTreeHostMus* window_tree_host) {
+ WindowMus* window = WindowMus::Get(window_tree_host->window());
+ const uint32_t change_id = ScheduleInFlightChange(
+ base::MakeUnique<CrashInFlightChange>(window, ChangeType::REORDER));
+ tree_->StackAtTop(change_id, window->server_id());
+}
+
std::unique_ptr<WindowPortMus> WindowTreeClient::CreateWindowPortForTopLevel(
const std::map<std::string, std::vector<uint8_t>>* properties) {
std::unique_ptr<WindowPortMus> window_port =
« no previous file with comments | « ui/aura/mus/window_tree_client.h ('k') | ui/aura/mus/window_tree_client_test_observer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698