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

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

Issue 2456843004: Wires up transient windows for aura-mus (Closed)
Patch Set: relative to master Created 4 years, 2 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_port_mus.h ('k') | ui/aura/mus/window_tree_client.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/aura/mus/window_port_mus.cc
diff --git a/ui/aura/mus/window_port_mus.cc b/ui/aura/mus/window_port_mus.cc
index 86431fb1c59238635e1e1f19413b027203e2ea37..aca205afc46f6600616096bff1f702b20a4d3d14 100644
--- a/ui/aura/mus/window_port_mus.cc
+++ b/ui/aura/mus/window_port_mus.cc
@@ -5,6 +5,7 @@
#include "ui/aura/mus/window_port_mus.h"
#include "ui/aura/client/aura_constants.h"
+#include "ui/aura/client/transient_window_client.h"
#include "ui/aura/mus/property_converter.h"
#include "ui/aura/mus/surface_id_handler.h"
#include "ui/aura/mus/window_tree_client.h"
@@ -84,7 +85,9 @@ bool WindowPortMus::RemoveChangeByTypeAndData(const ServerChangeType type,
switch (type) {
case ServerChangeType::ADD:
+ case ServerChangeType::ADD_TRANSIENT:
case ServerChangeType::REMOVE:
+ case ServerChangeType::REMOVE_TRANSIENT:
case ServerChangeType::REORDER:
if (iter->data.child_id == data.child_id)
break;
@@ -212,6 +215,49 @@ void WindowPortMus::SetSurfaceIdFromServer(
surface_info_ = std::move(surface_info);
}
+void WindowPortMus::AddTransientChildFromServer(WindowMus* child) {
+ DCHECK(has_server_window());
+ ServerChangeData data;
+ data.child_id = child->server_id();
+ ScopedServerChange change(this, ServerChangeType::ADD_TRANSIENT, data);
+ client::GetTransientWindowClient()->AddTransientChild(window_,
+ child->GetWindow());
+}
+
+void WindowPortMus::RemoveTransientChildFromServer(WindowMus* child) {
+ DCHECK(has_server_window());
+ ServerChangeData data;
+ data.child_id = child->server_id();
+ ScopedServerChange change(this, ServerChangeType::REMOVE_TRANSIENT, data);
+ client::GetTransientWindowClient()->RemoveTransientChild(window_,
+ child->GetWindow());
+}
+
+WindowPortMus::ChangeSource WindowPortMus::OnTransientChildAdded(
+ WindowMus* child) {
+ DCHECK(has_server_window());
+ ServerChangeData change_data;
+ change_data.child_id = child->server_id();
+ // If there was a change it means we scheduled the change by way of
+ // AddTransientChildFromServer(), which came from the server.
+ return RemoveChangeByTypeAndData(ServerChangeType::ADD_TRANSIENT, change_data)
+ ? ChangeSource::SERVER
+ : ChangeSource::LOCAL;
+}
+
+WindowPortMus::ChangeSource WindowPortMus::OnTransientChildRemoved(
+ WindowMus* child) {
+ DCHECK(has_server_window());
+ ServerChangeData change_data;
+ change_data.child_id = child->server_id();
+ // If there was a change it means we scheduled the change by way of
+ // RemoveTransientChildFromServer(), which came from the server.
+ return RemoveChangeByTypeAndData(ServerChangeType::REMOVE_TRANSIENT,
+ change_data)
+ ? ChangeSource::SERVER
+ : ChangeSource::LOCAL;
+}
+
std::unique_ptr<WindowMusChangeData>
WindowPortMus::PrepareForServerBoundsChange(const gfx::Rect& bounds) {
std::unique_ptr<WindowMusChangeDataImpl> data(
« no previous file with comments | « ui/aura/mus/window_port_mus.h ('k') | ui/aura/mus/window_tree_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698