diff options
Diffstat (limited to 'chrome/browser')
-rw-r--r-- | chrome/browser/gtk/browser_actions_toolbar_gtk.cc | 10 | ||||
-rw-r--r-- | chrome/browser/gtk/browser_actions_toolbar_gtk.h | 2 |
2 files changed, 9 insertions, 3 deletions
diff --git a/chrome/browser/gtk/browser_actions_toolbar_gtk.cc b/chrome/browser/gtk/browser_actions_toolbar_gtk.cc index c1921cd..365a8b0 100644 --- a/chrome/browser/gtk/browser_actions_toolbar_gtk.cc +++ b/chrome/browser/gtk/browser_actions_toolbar_gtk.cc @@ -267,7 +267,8 @@ BrowserActionsToolbarGtk::BrowserActionsToolbarGtk(Browser* browser) model_(NULL), hbox_(gtk_hbox_new(FALSE, kButtonPadding)), drag_button_(NULL), - drop_index_(-1) { + drop_index_(-1), + method_factory_(this) { ExtensionsService* extension_service = profile_->GetExtensionsService(); // The |extension_service| can be NULL in Incognito. if (!extension_service) @@ -487,6 +488,9 @@ void BrowserActionsToolbarGtk::OnHierarchyChanged() { } void BrowserActionsToolbarGtk::OnSetFocus() { - // The focus of the parent window has changed. Close the popup. - HidePopup(); + // The focus of the parent window has changed. Close the popup. Delay the hide + // because it will destroy the RenderViewHost, which may still be on the + // call stack. + MessageLoop::current()->PostTask(FROM_HERE, + method_factory_.NewRunnableMethod(&BrowserActionsToolbarGtk::HidePopup)); } diff --git a/chrome/browser/gtk/browser_actions_toolbar_gtk.h b/chrome/browser/gtk/browser_actions_toolbar_gtk.h index 1356320..fa71555 100644 --- a/chrome/browser/gtk/browser_actions_toolbar_gtk.h +++ b/chrome/browser/gtk/browser_actions_toolbar_gtk.h @@ -144,6 +144,8 @@ class BrowserActionsToolbarGtk : public ExtensionToolbarModel::Observer { ExtensionButtonMap; ExtensionButtonMap extension_button_map_; + ScopedRunnableMethodFactory<BrowserActionsToolbarGtk> method_factory_; + DISALLOW_COPY_AND_ASSIGN(BrowserActionsToolbarGtk); }; |