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

Unified Diff: ui/aura/window.h

Issue 37733003: Make GetRootWindow() return a Window instead of a RootWindow. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 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/test/ui_controls_factory_aurawin.cc ('k') | ui/aura/window.cc » ('j') | no next file with comments »
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 e908de4b470d6b54daf0e7b22b7a1c5cd1ca6d5c..e11f83acf5b507ef1d515770bf41b6e4564ea9f1 100644
--- a/ui/aura/window.h
+++ b/ui/aura/window.h
@@ -46,6 +46,9 @@ class RootWindow;
class WindowDelegate;
class WindowObserver;
+// TODO(beng): remove once RootWindow is renamed.
+typedef RootWindow WindowEventDispatcher;
+
// Defined in window_property.h (which we do not include)
template<typename T>
struct WindowProperty;
@@ -108,10 +111,19 @@ class AURA_EXPORT Window : public ui::LayerDelegate,
Window* parent() { return parent_; }
const Window* parent() const { return parent_; }
- // Returns the RootWindow that contains this Window or NULL if the Window is
- // not contained by a RootWindow.
- virtual RootWindow* GetRootWindow();
- virtual const RootWindow* GetRootWindow() const;
+ // Returns the root Window that contains this Window. The root Window is
+ // defined as the Window that has a dispatcher. These functions return NULL if
+ // the Window is contained in a hierarchy that does not have a dispatcher at
+ // its root.
+ virtual Window* GetRootWindow();
+ virtual const Window* GetRootWindow() const;
+
+ WindowEventDispatcher* GetDispatcher();
+ const WindowEventDispatcher* GetDispatcher() const;
+ void set_dispatcher(WindowEventDispatcher* dispatcher) {
+ dispatcher_ = dispatcher;
+ }
+ bool HasDispatcher() const { return !!dispatcher_; }
// The Window does not own this object.
void set_user_data(void* user_data) { user_data_ = user_data; }
@@ -475,6 +487,8 @@ class AURA_EXPORT Window : public ui::LayerDelegate,
// Returns true if the mouse is currently within our bounds.
bool ContainsMouse();
+ WindowEventDispatcher* dispatcher_;
+
client::WindowType type_;
// True if the Window is owned by its parent - i.e. it will be deleted by its
« no previous file with comments | « ui/aura/test/ui_controls_factory_aurawin.cc ('k') | ui/aura/window.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698