Index: views/controls/menu/menu_host.cc |
=================================================================== |
--- views/controls/menu/menu_host.cc (revision 85284) |
+++ views/controls/menu/menu_host.cc (working copy) |
@@ -31,8 +31,7 @@ |
const gfx::Rect& bounds, |
View* contents_view, |
bool do_capture) { |
- Widget::InitParams params; |
- params.type = Widget::InitParams::TYPE_MENU; |
+ Widget::InitParams params(Widget::InitParams::TYPE_MENU); |
params.has_dropshadow = true; |
#if defined(OS_WIN) |
params.parent = parent; |
@@ -40,6 +39,7 @@ |
params.parent = GTK_WIDGET(parent); |
#endif |
params.bounds = bounds; |
+ params.native_widget = native_menu_host_->AsNativeWidget(); |
GetWidget()->Init(params); |
GetWidget()->SetContentsView(contents_view); |
ShowMenuHost(do_capture); |
@@ -85,6 +85,18 @@ |
} |
//////////////////////////////////////////////////////////////////////////////// |
+// MenuHost, Widget overrides: |
+ |
+ |
+RootView* MenuHost::CreateRootView() { |
+ return new MenuHostRootView(GetWidget(), submenu_); |
+} |
+ |
+bool MenuHost::ShouldReleaseCaptureOnMouseReleased() const { |
+ return false; |
+} |
+ |
+//////////////////////////////////////////////////////////////////////////////// |
// MenuHost, internal::NativeMenuHostDelegate implementation: |
void MenuHost::OnNativeMenuHostDestroy() { |
@@ -105,12 +117,8 @@ |
menu_controller->CancelAll(); |
} |
-RootView* MenuHost::CreateRootView() { |
- return new MenuHostRootView(GetWidget(), submenu_); |
+internal::NativeWidgetDelegate* MenuHost::AsNativeWidgetDelegate() { |
+ return this; |
} |
-bool MenuHost::ShouldReleaseCaptureOnMouseRelease() const { |
- return false; |
-} |
- |
} // namespace views |