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

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

Issue 6881107: Rework the way Widget::Init works: (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 8 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_gtk.h ('k') | views/controls/menu/menu_host_win.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: views/controls/menu/menu_host_gtk.cc
===================================================================
--- views/controls/menu/menu_host_gtk.cc (revision 83020)
+++ views/controls/menu/menu_host_gtk.cc (working copy)
@@ -23,8 +23,7 @@
// MenuHostGtk, public:
MenuHostGtk::MenuHostGtk(internal::NativeMenuHostDelegate* delegate)
- : WidgetGtk(WidgetGtk::TYPE_POPUP),
- did_input_grab_(false),
+ : did_input_grab_(false),
delegate_(delegate) {
}
@@ -34,16 +33,6 @@
////////////////////////////////////////////////////////////////////////////////
// MenuHostGtk, NativeMenuHost implementation:
-void MenuHostGtk::InitMenuHost(gfx::NativeWindow parent,
- const gfx::Rect& bounds) {
- make_transient_to_parent();
- WidgetGtk::Init(GTK_WIDGET(parent), bounds);
- // Make sure we get destroyed when the parent is destroyed.
- gtk_window_set_destroy_with_parent(GTK_WINDOW(GetNativeView()), TRUE);
- gtk_window_set_type_hint(GTK_WINDOW(GetNativeView()),
- GDK_WINDOW_TYPE_HINT_MENU);
-}
-
void MenuHostGtk::StartCapturing() {
DCHECK(!did_input_grab_);
@@ -92,6 +81,15 @@
////////////////////////////////////////////////////////////////////////////////
// MenuHostGtk, WidgetGtk overrides:
+void MenuHostGtk::InitNativeWidget(const Widget::CreateParams& params) {
+ make_transient_to_parent();
+ WidgetGtk::InitNativeWidget(params);
+ // Make sure we get destroyed when the parent is destroyed.
+ gtk_window_set_destroy_with_parent(GTK_WINDOW(GetNativeView()), TRUE);
+ gtk_window_set_type_hint(GTK_WINDOW(GetNativeView()),
+ GDK_WINDOW_TYPE_HINT_MENU);
+}
+
// TODO(beng): remove once MenuHost is-a Widget
RootView* MenuHostGtk::CreateRootView() {
return delegate_->CreateRootView();
« no previous file with comments | « views/controls/menu/menu_host_gtk.h ('k') | views/controls/menu/menu_host_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698