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

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

Issue 2517853002: Fixes bug in handling restacking because of transients (Closed)
Patch Set: merge 2 trunk Created 4 years, 1 month 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
Index: ui/aura/mus/window_port_mus.h
diff --git a/ui/aura/mus/window_port_mus.h b/ui/aura/mus/window_port_mus.h
index a77095c869b1770edb18419020d12bda7332ac2a..1e08ce1b8c7ab83a480ca86d6206da8c8492f35e 100644
--- a/ui/aura/mus/window_port_mus.h
+++ b/ui/aura/mus/window_port_mus.h
@@ -113,12 +113,18 @@ class AURA_EXPORT WindowPortMus : public WindowPort, public WindowMus {
REMOVE,
REMOVE_TRANSIENT,
REORDER,
+ // This is used when a REORDER *may* occur as the result of a transient
+ // child being added or removed. As there is no guarantee the move will
+ // actually happen (the window may be in place already) this change is not
+ // automatically removed. Instead the change is explicitly removed.
+ TRANSIENT_REORDER,
VISIBLE,
};
// Contains data needed to identify a change from the server.
struct ServerChangeData {
- // Applies to ADD, ADD_TRANSIENT, REMOVE, REMOVE_TRANSIENT and REORDER.
+ // Applies to ADD, ADD_TRANSIENT, REMOVE, REMOVE_TRANSIENT, REORDER and
+ // TRANSIENT_REORDER.
Id child_id;
// Applies to BOUNDS.
gfx::Rect bounds;
@@ -137,6 +143,8 @@ class AURA_EXPORT WindowPortMus : public WindowPort, public WindowMus {
ServerChangeData data;
};
+ using ServerChanges = std::vector<ServerChange>;
+
// Convenience for adding/removing a ScopedChange.
class ScopedServerChange {
public:
@@ -175,6 +183,10 @@ class AURA_EXPORT WindowPortMus : public WindowPort, public WindowMus {
bool RemoveChangeByTypeAndData(const ServerChangeType type,
const ServerChangeData& data);
+ ServerChanges::iterator FindServerChangeByTypeAndData(
msw 2016/11/21 19:56:34 nit: nix 'Server' here or add to functions above?
sky 2016/11/21 21:31:43 Done.
+ const ServerChangeType type,
+ const ServerChangeData& data);
+
PropertyConverter* GetPropertyConverter();
// WindowMus:
@@ -200,6 +212,8 @@ class AURA_EXPORT WindowPortMus : public WindowPort, public WindowMus {
ChangeSource OnTransientChildRemoved(WindowMus* child) override;
std::unique_ptr<WindowMusChangeData> PrepareForServerBoundsChange(
const gfx::Rect& bounds) override;
+ void PrepareForTransientRestack(WindowMus* window) override;
msw 2016/11/21 19:56:34 nit: order these just after PrepareForServerVisibi
sky 2016/11/21 21:31:43 Done.
+ void OnTransientRestackDone(WindowMus* window) override;
std::unique_ptr<WindowMusChangeData> PrepareForServerVisibilityChange(
bool value) override;
void NotifyEmbeddedAppDisconnected() override;
@@ -223,7 +237,7 @@ class AURA_EXPORT WindowPortMus : public WindowPort, public WindowMus {
Window* window_ = nullptr;
ServerChangeIdType next_server_change_id_ = 0;
- std::vector<ServerChange> server_changes_;
+ ServerChanges server_changes_;
SurfaceIdHandler* surface_id_handler_;
std::unique_ptr<SurfaceInfo> surface_info_;

Powered by Google App Engine
This is Rietveld 408576698