| 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_;
|
|
|