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

Unified Diff: ui/aura/env.h

Issue 2446893005: Adds a porting layer so aura can be made to work with mus (Closed)
Patch Set: better 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/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 01b9e0ddaf45f286d8a301af4a3125803e6f45d6..d557a1f50f54d8f82d6276feaa940d017d1fb135 100644
--- a/ui/aura/env.h
+++ b/ui/aura/env.h
@@ -7,6 +7,7 @@
#include <memory>
+#include "base/callback.h"
#include "base/macros.h"
#include "base/observer_list.h"
#include "base/supports_user_data.h"
@@ -28,6 +29,7 @@ class EnvTestHelper;
class EnvObserver;
class InputStateLookup;
class Window;
+class WindowPort;
class WindowTreeHost;
// A singleton object that tracks general state within Aura.
@@ -35,10 +37,16 @@ class AURA_EXPORT Env : public ui::EventTarget, public base::SupportsUserData {
public:
~Env() override;
- static std::unique_ptr<Env> CreateInstance();
+ using WindowPortFactory =
+ base::Callback<std::unique_ptr<WindowPort>(Window* window)>;
+ static std::unique_ptr<Env> CreateInstance(
+ const WindowPortFactory& window_port_factory = WindowPortFactory());
static Env* GetInstance();
static Env* GetInstanceDontCreate();
+ // Called internally to create the appropriate WindowPort implementation.
+ std::unique_ptr<WindowPort> CreateWindowPort(Window* window);
+
void AddObserver(EnvObserver* observer);
void RemoveObserver(EnvObserver* observer);
@@ -71,7 +79,7 @@ class AURA_EXPORT Env : public ui::EventTarget, public base::SupportsUserData {
friend class Window;
friend class WindowTreeHost;
- Env();
+ explicit Env(const WindowPortFactory& window_port_factory);
void Init();
@@ -90,6 +98,8 @@ class AURA_EXPORT Env : public ui::EventTarget, public base::SupportsUserData {
std::unique_ptr<ui::EventTargetIterator> GetChildIterator() const override;
ui::EventTargeter* GetEventTargeter() override;
+ WindowPortFactory window_port_factory_;
+
base::ObserverList<EnvObserver> observers_;
int mouse_button_flags_;
« 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