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

Unified Diff: chrome/browser/views/browser_actions_container.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 | « chrome/browser/views/browser_actions_container.h ('k') | views/controls/menu/native_menu_gtk.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/views/browser_actions_container.cc
===================================================================
--- chrome/browser/views/browser_actions_container.cc (revision 42514)
+++ chrome/browser/views/browser_actions_container.cc (working copy)
@@ -125,7 +125,13 @@
Extension::kBrowserActionIconMaxSize));
}
-BrowserActionButton::~BrowserActionButton() {
+void BrowserActionButton::Destroy() {
+ if (showing_context_menu_) {
+ context_menu_menu_->CancelMenu();
+ MessageLoop::current()->DeleteSoon(FROM_HERE, this);
+ } else {
+ delete this;
+ }
}
gfx::Insets BrowserActionButton::GetInsets() const {
@@ -235,6 +241,8 @@
context_menu_menu_->RunContextMenuAt(point);
SetButtonNotPushed();
+ showing_context_menu_ = false;
+
return false;
} else if (IsPopup()) {
return MenuButton::OnMousePressed(e);
@@ -276,7 +284,10 @@
menu_visible_ = false;
}
+BrowserActionButton::~BrowserActionButton() {
+}
+
////////////////////////////////////////////////////////////////////////////////
// BrowserActionView
@@ -289,6 +300,11 @@
button_->UpdateState();
}
+BrowserActionView::~BrowserActionView() {
+ RemoveChildView(button_);
+ button_->Destroy();
+}
+
gfx::Canvas* BrowserActionView::GetIconWithBadge() {
int tab_id = panel_->GetCurrentTabId();
« no previous file with comments | « chrome/browser/views/browser_actions_container.h ('k') | views/controls/menu/native_menu_gtk.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698