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

Unified Diff: chrome/browser/ui/gtk/browser_actions_toolbar_gtk.cc

Issue 6354021: Disable context menu for page_action and infobars (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: gtk version fixed Created 9 years, 11 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 | « no previous file | chrome/browser/ui/gtk/location_bar_view_gtk.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/gtk/browser_actions_toolbar_gtk.cc
diff --git a/chrome/browser/ui/gtk/browser_actions_toolbar_gtk.cc b/chrome/browser/ui/gtk/browser_actions_toolbar_gtk.cc
index 0a0a9401f2e8ddf6ff252cadf9cc1d4b108ce442..f2f6020be6bc62b38b7a9aa9b6dc414c41d0d551 100644
--- a/chrome/browser/ui/gtk/browser_actions_toolbar_gtk.cc
+++ b/chrome/browser/ui/gtk/browser_actions_toolbar_gtk.cc
@@ -202,6 +202,9 @@ class BrowserActionButton : public NotificationObserver,
}
MenuGtk* GetContextMenu() {
+ if (!extension_->ShowConfigureContextMenus())
+ return NULL;
+
context_menu_model_ =
new ExtensionContextMenuModel(extension_, toolbar_->browser(), this);
context_menu_.reset(
@@ -268,8 +271,12 @@ class BrowserActionButton : public NotificationObserver,
if (event->button.button != 3)
return FALSE;
+ MenuGtk* menu = action->GetContextMenu();
+ if (!menu)
+ return FALSE;
+
action->button_->SetPaintOverride(GTK_STATE_ACTIVE);
- action->GetContextMenu()->Popup(widget, event);
+ menu->Popup(widget, event);
return TRUE;
}
@@ -939,7 +946,11 @@ gboolean BrowserActionsToolbarGtk::OnOverflowMenuButtonPress(
return FALSE;
}
- it->second.get()->GetContextMenu()->PopupAsContext(event->time);
+ MenuGtk* menu = it->second.get()->GetContextMenu();
+ if (!menu)
+ return FALSE;
+
+ menu->PopupAsContext(event->time);
return TRUE;
}
« no previous file with comments | « no previous file | chrome/browser/ui/gtk/location_bar_view_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698