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

Unified Diff: chrome/browser/ui/views/toolbar/toolbar_action_view.cc

Issue 1494433003: Fixes a crash when InkDropDelegate gets destroyed after its InkDropHost (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixes a crash when InkDropDelegate gets destroyed after its InkDropHost (delegate owned by a leaf c… Created 5 years 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
Index: chrome/browser/ui/views/toolbar/toolbar_action_view.cc
diff --git a/chrome/browser/ui/views/toolbar/toolbar_action_view.cc b/chrome/browser/ui/views/toolbar/toolbar_action_view.cc
index 524fb9525cedfeabefa855b52dad6f68772f4f7d..e11905b73c53ffe2e8459523ec144913f83f1fbe 100644
--- a/chrome/browser/ui/views/toolbar/toolbar_action_view.cc
+++ b/chrome/browser/ui/views/toolbar/toolbar_action_view.cc
@@ -67,10 +67,9 @@ ToolbarActionView::ToolbarActionView(
called_register_command_(false),
wants_to_run_(false),
menu_(nullptr),
+ ink_drop_delegate_(new views::ButtonInkDropDelegate(this, this)),
weak_factory_(this) {
- scoped_ptr<views::InkDropDelegate> new_ink_drop_delegate(
- new views::ButtonInkDropDelegate(this, this));
- SetInkDropDelegate(new_ink_drop_delegate.Pass());
+ set_ink_drop_delegate(ink_drop_delegate_.get());
set_id(VIEW_ID_BROWSER_ACTION);
view_controller_->SetDelegate(this);
SetHorizontalAlignment(gfx::ALIGN_CENTER);
@@ -109,6 +108,8 @@ ToolbarActionView::~ToolbarActionView() {
if (context_menu_owner == this)
context_menu_owner = nullptr;
view_controller_->SetDelegate(nullptr);
+ ink_drop_delegate_.reset();
+ set_ink_drop_delegate(nullptr);
}
void ToolbarActionView::GetAccessibleState(ui::AXViewState* state) {
« no previous file with comments | « chrome/browser/ui/views/toolbar/toolbar_action_view.h ('k') | ui/views/animation/ink_drop_delegate_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698