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

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

Issue 1237004: Views: fix a crash where in the browser actions container.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 9 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/native_menu_gtk.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: views/controls/menu/native_menu_gtk.cc
===================================================================
--- views/controls/menu/native_menu_gtk.cc (revision 42514)
+++ views/controls/menu/native_menu_gtk.cc (working copy)
@@ -112,11 +112,11 @@
// Listen for "hide" signal so that we know when to return from the blocking
// RunMenuAt call.
gint hide_handle_id =
- g_signal_connect(menu_, "hide", G_CALLBACK(OnMenuHidden), this);
+ g_signal_connect(menu_, "hide", G_CALLBACK(OnMenuHiddenThunk), this);
gint move_handle_id =
- g_signal_connect(menu_, "move-current", G_CALLBACK(OnMenuMoveCurrent),
- this);
+ g_signal_connect(menu_, "move-current",
+ G_CALLBACK(OnMenuMoveCurrentThunk), this);
// Block until menu is no longer shown by running a nested message loop.
MessageLoopForUI::current()->Run(NULL);
@@ -133,7 +133,7 @@
}
void NativeMenuGtk::CancelMenu() {
- NOTIMPLEMENTED();
+ gtk_widget_hide(menu_);
}
void NativeMenuGtk::Rebuild() {
@@ -208,9 +208,8 @@
////////////////////////////////////////////////////////////////////////////////
// NativeMenuGtk, private:
-// static
-void NativeMenuGtk::OnMenuHidden(GtkWidget* widget, NativeMenuGtk* menu) {
- if (!menu->menu_shown_) {
+void NativeMenuGtk::OnMenuHidden(GtkWidget* widget) {
+ if (!menu_shown_) {
// This indicates we don't have a menu open, and should never happen.
NOTREACHED();
return;
@@ -219,10 +218,8 @@
MessageLoop::current()->Quit();
}
-// static
-void NativeMenuGtk::OnMenuMoveCurrent(GtkMenu* menu_widget,
- GtkMenuDirectionType focus_direction,
- NativeMenuGtk* menu) {
+void NativeMenuGtk::OnMenuMoveCurrent(GtkWidget* menu_widget,
+ GtkMenuDirectionType focus_direction) {
GtkWidget* parent = GTK_MENU_SHELL(menu_widget)->parent_menu_shell;
GtkWidget* menu_item = GTK_MENU_SHELL(menu_widget)->active_menu_item;
GtkWidget* submenu = NULL;
@@ -231,11 +228,11 @@
}
if (focus_direction == GTK_MENU_DIR_CHILD && submenu == NULL) {
- menu->GetAncestor()->menu_action_ = MENU_ACTION_NEXT;
- gtk_menu_popdown(menu_widget);
+ GetAncestor()->menu_action_ = MENU_ACTION_NEXT;
+ gtk_menu_popdown(GTK_MENU(menu_widget));
} else if (focus_direction == GTK_MENU_DIR_PARENT && parent == NULL) {
- menu->GetAncestor()->menu_action_ = MENU_ACTION_PREVIOUS;
- gtk_menu_popdown(menu_widget);
+ GetAncestor()->menu_action_ = MENU_ACTION_PREVIOUS;
+ gtk_menu_popdown(GTK_MENU(menu_widget));
}
}
« no previous file with comments | « views/controls/menu/native_menu_gtk.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698