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

Issue 2846363004: Make extension callbacks with auto-dismissing dialogs (Closed)

Created:
3 years, 7 months ago by Avi (use Gerrit)
Modified:
3 years, 7 months ago
Reviewers:
Devlin
CC:
chromium-reviews
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Make extension callbacks with auto-dismissing dialogs BUG=716794

Patch Set 1 #

Patch Set 2 : reupload; no code change #

Unified diffs Side-by-side diffs Delta from patch set Stats (+18 lines, -0 lines) Patch
M chrome/browser/ui/javascript_dialogs/javascript_dialog_tab_helper.h View 1 chunk +3 lines, -0 lines 0 comments Download
M chrome/browser/ui/javascript_dialogs/javascript_dialog_tab_helper.cc View 5 chunks +9 lines, -0 lines 0 comments Download
M components/app_modal/javascript_dialog_manager.h View 1 chunk +1 line, -0 lines 0 comments Download
M components/app_modal/javascript_dialog_manager.cc View 1 chunk +5 lines, -0 lines 0 comments Download

Dependent Patchsets:

Messages

Total messages: 14 (9 generated)
Avi (use Gerrit)
3 years, 7 months ago (2017-04-29 23:15:30 UTC) #6
Devlin
The JavaScriptDialogExtensionsClient is used to increment the keepalive count for an extension event page (and, ...
3 years, 7 months ago (2017-05-01 00:18:01 UTC) #11
Avi (use Gerrit)
On 2017/05/01 00:18:01, Devlin wrote: > The JavaScriptDialogExtensionsClient is used to increment the keepalive count ...
3 years, 7 months ago (2017-05-01 00:38:13 UTC) #12
Devlin
On 2017/05/01 00:38:13, Avi (ping after 24h) wrote: > On 2017/05/01 00:18:01, Devlin wrote: > ...
3 years, 7 months ago (2017-05-01 04:55:08 UTC) #13
Avi (use Gerrit)
3 years, 7 months ago (2017-05-01 13:49:31 UTC) #14
On 2017/05/01 04:55:08, Devlin wrote:
> On 2017/05/01 00:38:13, Avi (ping after 24h) wrote:
> > On 2017/05/01 00:18:01, Devlin wrote:
> > > The JavaScriptDialogExtensionsClient is used to increment the keepalive
> count
> > > for an extension event page (and, as you discovered, as a place to hook
into
> > for
> > > tests - but that's less functionally important).  It looks like the
> > > JavaScriptDialogTabHelper is only created for tabs, though, and I don't
> > *think*
> > > we call TabHelpers::AttachTabHelpers for background pages normally.  If
> that's
> > > the case, we'd need to add a different
> > > JavaScriptDialogTabHelper::CreateForWebContents call somewhere, like
> > > ChromeExtensionHostDelegate::OnExtensionHostCreated().
> > > 
> > > That said, would not having the JavascriptDialogTabHelper created for a
web
> > > contents that can create dialogs cause other problems as well?
> > 
> > As a bit of explanation:
> > 
> > Yes, the JavaScriptDialogTabHelper is only created for tabs, and when a
> > WebContents that's used as a tab calls
> > WebContentsDelegate::GetJavaScriptDialogManager(), its delegate is the
Browser
> > and the Browser object returns the JavaScriptDialogTabHelper.
> > 
> > What is the delegate for a background page? That delegate is what returns
the
> > JavaScriptDialogManager used for a page.
> 
> The WebContentsDelegate for a background page is the ExtensionHost, which
> (through a bit of redirection) returns the app_modal::JavaScriptDialogManager
> singleton instance.  This singleton looks like it *does* call into the
> extensions client equivalent.
> 
> So, if my interpretation is correct, the new tab helper implementation is
> completely circumvented for background page alerts.  On the upside, this means
> the keepalive count and other logic is, hopefully, correct.  But does this
cause
> problems for anything else?

No, and that is the intention.

Closing this review as it is indeed the wrong approach.

Powered by Google App Engine
This is Rietveld 408576698