diff options
Diffstat (limited to 'views/widget/widget_win.cc')
-rw-r--r-- | views/widget/widget_win.cc | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/views/widget/widget_win.cc b/views/widget/widget_win.cc index b883edd..e0edee8 100644 --- a/views/widget/widget_win.cc +++ b/views/widget/widget_win.cc @@ -362,29 +362,6 @@ void WidgetWin::SetUseLayeredBuffer(bool use_layered_buffer) { } } -static BOOL CALLBACK EnumChildProc(HWND hwnd, LPARAM l_param) { - RootView* root_view = - reinterpret_cast<RootView*>(GetProp(hwnd, kRootViewWindowProperty)); - if (root_view) { - *reinterpret_cast<RootView**>(l_param) = root_view; - return FALSE; // Stop enumerating. - } - return TRUE; // Keep enumerating. -} - -// static -RootView* WidgetWin::FindRootView(HWND hwnd) { - RootView* root_view = - reinterpret_cast<RootView*>(GetProp(hwnd, kRootViewWindowProperty)); - if (root_view) - return root_view; - - // Enumerate all children and check if they have a RootView. - EnumChildWindows(hwnd, EnumChildProc, reinterpret_cast<LPARAM>(&root_view)); - - return root_view; -} - // static WidgetWin* WidgetWin::GetWidget(HWND hwnd) { return reinterpret_cast<WidgetWin*>(win_util::GetWindowUserData(hwnd)); @@ -1184,4 +1161,27 @@ Widget* Widget::CreatePopupWidget(TransparencyParam transparent, return popup; } +static BOOL CALLBACK EnumChildProc(HWND hwnd, LPARAM l_param) { + RootView* root_view = + reinterpret_cast<RootView*>(GetProp(hwnd, kRootViewWindowProperty)); + if (root_view) { + *reinterpret_cast<RootView**>(l_param) = root_view; + return FALSE; // Stop enumerating. + } + return TRUE; // Keep enumerating. +} + +// static +RootView* Widget::FindRootView(HWND hwnd) { + RootView* root_view = + reinterpret_cast<RootView*>(GetProp(hwnd, kRootViewWindowProperty)); + if (root_view) + return root_view; + + // Enumerate all children and check if they have a RootView. + EnumChildWindows(hwnd, EnumChildProc, reinterpret_cast<LPARAM>(&root_view)); + + return root_view; +} + } // namespace views |