diff options
author | ananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-02 06:11:22 +0000 |
---|---|---|
committer | ananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-02 06:11:22 +0000 |
commit | 3ef5d1b8cd0d307dda2b03b7d8bf9c8d7d97e870 (patch) | |
tree | 7725c4b1c02db26a7e09c30d325c2777109228d6 /views/window | |
parent | 99f5dfdbdf3b9d948750a4bbed07b0a2eef2337e (diff) | |
download | chromium_src-3ef5d1b8cd0d307dda2b03b7d8bf9c8d7d97e870.zip chromium_src-3ef5d1b8cd0d307dda2b03b7d8bf9c8d7d97e870.tar.gz chromium_src-3ef5d1b8cd0d307dda2b03b7d8bf9c8d7d97e870.tar.bz2 |
Reverting to fix builder redness. Please fix and reland.
Revert 76483 - Remove/replace RootView/Widget getters with new NativeWidget getters.
BUG=72040
TEST=existing unittests.
Review URL: http://codereview.chromium.org/6598069
TBR=ben@chromium.org
Review URL: http://codereview.chromium.org/6597099
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@76508 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views/window')
-rw-r--r-- | views/window/window_gtk.cc | 3 | ||||
-rw-r--r-- | views/window/window_win.cc | 14 |
2 files changed, 10 insertions, 7 deletions
diff --git a/views/window/window_gtk.cc b/views/window/window_gtk.cc index a47bc32..09e1984 100644 --- a/views/window/window_gtk.cc +++ b/views/window/window_gtk.cc @@ -97,8 +97,7 @@ void Window::CloseAllSecondaryWindows() { for (GList* window = windows; window; window = g_list_next(window)) { Window::CloseSecondaryWidget( - NativeWidget::GetNativeWidgetForNativeView( - GTK_WIDGET(window->data))->GetWidget()); + WidgetGtk::GetViewForNative(GTK_WIDGET(window->data))); } g_list_free(windows); } diff --git a/views/window/window_win.cc b/views/window/window_win.cc index 0bff7c0..239226d 100644 --- a/views/window/window_win.cc +++ b/views/window/window_win.cc @@ -1531,11 +1531,15 @@ void WindowWin::InitClass() { } namespace { -BOOL CALLBACK WindowCallbackProc(HWND hwnd, LPARAM lParam) { - NativeWidget* native_widget = - NativeWidget::GetNativeWidgetForNativeView(hwnd); - if (native_widget) - Window::CloseSecondaryWidget(native_widget->GetWidget()); +// static +static BOOL CALLBACK WindowCallbackProc(HWND hwnd, LPARAM lParam) { + // This is safer than calling GetWindowUserData, since it looks specifically + // for the RootView window property which should be unique. + RootView* root_view = GetRootViewForHWND(hwnd); + if (!root_view) + return TRUE; + + Window::CloseSecondaryWidget(root_view->GetWidget()); return TRUE; } } // namespace |