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

Unified Diff: ui/aura/window.h

Issue 2446893005: Adds a porting layer so aura can be made to work with mus (Closed)
Patch Set: cleanup 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/env.cc ('k') | ui/aura/window.cc » ('j') | ui/aura/window.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « ui/aura/env.cc ('k') | ui/aura/window.cc » ('j') | ui/aura/window.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698