| Index: chrome/browser/extensions/api/bookmark_manager_private/bookmark_manager_private_api.cc
|
| diff --git a/chrome/browser/extensions/api/bookmark_manager_private/bookmark_manager_private_api.cc b/chrome/browser/extensions/api/bookmark_manager_private/bookmark_manager_private_api.cc
|
| index b27b6cd135a4ee1c7c5f2477e5978c8bec6d4838..cc139f9e709fdd6724bc09269314a307f256ff8c 100644
|
| --- a/chrome/browser/extensions/api/bookmark_manager_private/bookmark_manager_private_api.cc
|
| +++ b/chrome/browser/extensions/api/bookmark_manager_private/bookmark_manager_private_api.cc
|
| @@ -291,6 +291,8 @@ BookmarkManagerPrivateDragEventRouter::BookmarkManagerPrivateDragEventRouter(
|
| : web_contents_(web_contents),
|
| profile_(
|
| Profile::FromBrowserContext(web_contents_->GetBrowserContext())) {
|
| + // We need to guarantee the BookmarkTabHelper is created.
|
| + BookmarkTabHelper::CreateForWebContents(web_contents_);
|
| BookmarkTabHelper* bookmark_tab_helper =
|
| BookmarkTabHelper::FromWebContents(web_contents_);
|
| bookmark_tab_helper->set_bookmark_drag_delegate(this);
|
| @@ -298,10 +300,8 @@ BookmarkManagerPrivateDragEventRouter::BookmarkManagerPrivateDragEventRouter(
|
|
|
| BookmarkManagerPrivateDragEventRouter::
|
| ~BookmarkManagerPrivateDragEventRouter() {
|
| - BookmarkTabHelper* bookmark_tab_helper =
|
| - BookmarkTabHelper::FromWebContents(web_contents_);
|
| - if (bookmark_tab_helper->bookmark_drag_delegate() == this)
|
| - bookmark_tab_helper->set_bookmark_drag_delegate(NULL);
|
| + // No need to remove ourselves as the BookmarkTabHelper's delegate, since they
|
| + // are both WebContentsUserData and will be deleted at the same time.
|
| }
|
|
|
| void BookmarkManagerPrivateDragEventRouter::MaybeCreateForWebContents(
|
|
|