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

Unified Diff: views/controls/menu/menu_host.cc

Issue 7015051: Re-land: (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 7 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 | « views/controls/menu/menu_host.h ('k') | views/controls/menu/menu_host_gtk.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « views/controls/menu/menu_host.h ('k') | views/controls/menu/menu_host_gtk.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698