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

Unified Diff: ui/aura/env.h

Issue 2897663002: chromeos: makes it possible for windows to outlive WindowTreeClient (Closed)
Patch Set: cleanup Created 3 years, 7 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/BUILD.gn ('k') | ui/aura/env.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/aura/env.h
diff --git a/ui/aura/env.h b/ui/aura/env.h
index 303e7b66d6de21fb429140a7fd3cf0982bebc0ce..f819a7572d1412df5dd854009b90a7371bcaef63 100644
--- a/ui/aura/env.h
+++ b/ui/aura/env.h
@@ -117,6 +117,7 @@ class AURA_EXPORT Env : public ui::EventTarget,
friend class EventInjector;
friend class MusMouseLocationUpdater;
friend class Window;
+ friend class WindowTreeClient; // For call to WindowTreeClientDestroyed().
friend class WindowTreeHost;
explicit Env(Mode mode);
@@ -137,6 +138,8 @@ class AURA_EXPORT Env : public ui::EventTarget,
// Invoked by WindowTreeHost when it is activated. Notifies observers.
void NotifyHostActivated(WindowTreeHost* host);
+ void WindowTreeClientDestroyed(WindowTreeClient* client);
+
// Overridden from ui::EventTarget:
bool CanAcceptEvent(const ui::Event& event) override;
ui::EventTarget* GetParentTarget() override;
@@ -151,7 +154,8 @@ class AURA_EXPORT Env : public ui::EventTarget,
Mode mode_;
// Intentionally not exposed publicly. Someday we might want to support
- // multiple WindowTreeClients. Use EnvTestHelper in tests.
+ // multiple WindowTreeClients. Use EnvTestHelper in tests. This is set to null
+ // during shutdown.
WindowTreeClient* window_tree_client_ = nullptr;
base::ObserverList<EnvObserver> observers_;
@@ -180,6 +184,10 @@ class AURA_EXPORT Env : public ui::EventTarget,
ui::ContextFactory* context_factory_;
ui::ContextFactoryPrivate* context_factory_private_;
+ // This is set to true when the WindowTreeClient is destroyed. It triggers
+ // creating a different WindowPort implementation.
+ bool in_mus_shutdown_ = false;
+
DISALLOW_COPY_AND_ASSIGN(Env);
};
« no previous file with comments | « ui/aura/BUILD.gn ('k') | ui/aura/env.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698