Chromium Code Reviews| Index: ui/aura/window.h |
| diff --git a/ui/aura/window.h b/ui/aura/window.h |
| index f27c2be65f04686235c7204dd1d4c549c560fd45..185532135398fe4d6ab637e6c82b734ac0108dae 100644 |
| --- a/ui/aura/window.h |
| +++ b/ui/aura/window.h |
| @@ -9,6 +9,7 @@ |
| #include <map> |
| #include <memory> |
| +#include <set> |
| #include <string> |
| #include <vector> |
| @@ -50,6 +51,7 @@ namespace aura { |
| class LayoutManager; |
| class WindowDelegate; |
| +class WindowPort; |
| class WindowObserver; |
| class WindowTreeHost; |
| @@ -85,6 +87,7 @@ class AURA_EXPORT Window : public ui::LayerDelegate, |
| typedef std::vector<Window*> Windows; |
| explicit Window(WindowDelegate* delegate); |
| + Window(WindowDelegate* delegate, std::unique_ptr<WindowPort> port); |
| ~Window() override; |
| // Initializes the window. This creates the window's layer. |
| @@ -313,6 +316,9 @@ class AURA_EXPORT Window : public ui::LayerDelegate, |
| template<typename T> |
| void ClearProperty(const WindowProperty<T>* property); |
| + // Returns the value of all properties with a non-default value. |
| + std::set<const void*> GetAllPropertKeys() const; |
| + |
| // NativeWidget::[GS]etNativeWindowProperty use strings as keys, and this is |
| // difficult to change while retaining compatibility with other platforms. |
| // TODO(benrg): Find a better solution. |
| @@ -340,10 +346,12 @@ class AURA_EXPORT Window : public ui::LayerDelegate, |
| void RemoveOrDestroyChildren(); |
| private: |
| - friend class test::WindowTestApi; |
| friend class LayoutManager; |
| + friend class WindowPort; |
| friend class WindowTargeter; |
| friend class subtle::PropertyHelper; |
| + friend class test::WindowTestApi; |
| + |
| // Called by the public {Set,Get,Clear}Property functions. |
| int64_t SetPropertyInternal(const void* key, |
| const char* name, |
| @@ -460,6 +468,12 @@ class AURA_EXPORT Window : public ui::LayerDelegate, |
| // Updates the layer name based on the window's name and id. |
| void UpdateLayerName(); |
| + // Window owns its corresponding WindowPort, but the ref is held as a raw |
| + // pointer so that |port_| is still valid while being destroyed. This is |
| + // important as deleting the WindowPort may result in trying to lookup the |
| + // |port_| associated with the Window. |
| + WindowPort* port_; |
|
sadrul
2016/10/26 04:25:55
Should we still use a unique_ptr<> here, and std::
sky
2016/10/26 16:25:21
I still need the ability to get the port_ during d
|
| + |
| // Bounds of this window relative to the parent. This is cached as the bounds |
| // of the Layer and Window are not necessarily the same. In particular bounds |
| // of the Layer are relative to the first ancestor with a Layer, where as this |