| Index: chrome/browser/previews/previews_infobar_delegate.cc
|
| diff --git a/chrome/browser/previews/previews_infobar_delegate.cc b/chrome/browser/previews/previews_infobar_delegate.cc
|
| index 3a34ccddb693d3f087eb995260c839f582692a79..987b4a0a4408d5b5e672ed30bb39e77eb8ff1fad 100644
|
| --- a/chrome/browser/previews/previews_infobar_delegate.cc
|
| +++ b/chrome/browser/previews/previews_infobar_delegate.cc
|
| @@ -59,12 +59,16 @@ void PreviewsInfoBarDelegate::Create(
|
| const OnDismissPreviewsInfobarCallback& on_dismiss_callback) {
|
| PreviewsInfoBarTabHelper* infobar_tab_helper =
|
| PreviewsInfoBarTabHelper::FromWebContents(web_contents);
|
| - if (infobar_tab_helper->displayed_preview_infobar())
|
| - return;
|
| -
|
| InfoBarService* infobar_service =
|
| InfoBarService::FromWebContents(web_contents);
|
|
|
| + // The WebContents may not have TabHelpers set. If TabHelpers are not set,
|
| + // don't show Previews infobars.
|
| + if (!infobar_tab_helper || !infobar_service)
|
| + return;
|
| + if (infobar_tab_helper->displayed_preview_infobar())
|
| + return;
|
| +
|
| infobars::InfoBar* infobar =
|
| infobar_service->AddInfoBar(infobar_service->CreateConfirmInfoBar(
|
| std::unique_ptr<ConfirmInfoBarDelegate>(new PreviewsInfoBarDelegate(
|
|
|