diff options
author | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-02 01:13:38 +0000 |
---|---|---|
committer | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-02 01:13:38 +0000 |
commit | d8d70b1414befb63913ada0abfc135eafd97a8a1 (patch) | |
tree | 3d4a290b8121549acfd8aefbb01170624726ab78 /views/widget/native_widget.h | |
parent | b472d4f576eb17916ab3444218dcb4586f60a247 (diff) | |
download | chromium_src-d8d70b1414befb63913ada0abfc135eafd97a8a1.zip chromium_src-d8d70b1414befb63913ada0abfc135eafd97a8a1.tar.gz chromium_src-d8d70b1414befb63913ada0abfc135eafd97a8a1.tar.bz2 |
Remove/replace RootView/Widget getters with new NativeWidget getters.
BUG=72040
TEST=existing unittests.
Review URL: http://codereview.chromium.org/6598069
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@76483 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views/widget/native_widget.h')
-rw-r--r-- | views/widget/native_widget.h | 28 |
1 files changed, 26 insertions, 2 deletions
diff --git a/views/widget/native_widget.h b/views/widget/native_widget.h index 2700f8c..dffbf93 100644 --- a/views/widget/native_widget.h +++ b/views/widget/native_widget.h @@ -6,8 +6,11 @@ #define VIEWS_WIDGET_NATIVE_WIDGET_H_ #pragma once +#include <set> + namespace views { -namespace internal { + +class Widget; //////////////////////////////////////////////////////////////////////////////// // NativeWidget interface @@ -18,9 +21,30 @@ namespace internal { class NativeWidget { public: virtual ~NativeWidget() {} + + // Retrieves the NativeWidget implementation associated with the given + // NativeView or Window, or NULL if the supplied handle has no associated + // NativeView. + static NativeWidget* GetNativeWidgetForNativeView( + gfx::NativeView native_view); + static NativeWidget* GetNativeWidgetForNativeWindow( + gfx::NativeWindow native_window); + + // Retrieves the top NativeWidget in the hierarchy containing the given + // NativeView, or NULL if there is no NativeWidget that contains it. + static NativeWidget* GetTopLevelNativeWidget(gfx::NativeView native_view); + + // Returns all NativeWidgets in |native_view|'s hierarchy, including itself if + // it is one. + typedef std::set<NativeWidget*> NativeWidgets; + static void GetAllNativeWidgets(gfx::NativeView native_view, + NativeWidgets* children); + + // Returns the Widget associated with this NativeWidget. This function is + // guaranteed to return non-NULL for the lifetime of the NativeWidget. + virtual Widget* GetWidget() = 0; }; -} // namespace internal } // namespace views #endif // VIEWS_WIDGET_NATIVE_WIDGET_H_ |