diff options
author | mathiash <mathiash@opera.com> | 2014-11-19 00:18:50 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-11-19 08:19:29 +0000 |
commit | 72a5e46303c13d806475cd01aedfb1305fcde5d7 (patch) | |
tree | 115076de45eb77d6d0ec3ec220d681ad977acd23 /content/public/browser/web_contents_delegate.h | |
parent | bc4af0395bb3c948c7704a83bc989ca770d1d7f9 (diff) | |
download | chromium_src-72a5e46303c13d806475cd01aedfb1305fcde5d7.zip chromium_src-72a5e46303c13d806475cd01aedfb1305fcde5d7.tar.gz chromium_src-72a5e46303c13d806475cd01aedfb1305fcde5d7.tar.bz2 |
Add WebContents source to methods in WebContentsDelegate
The added parameter helps us avoid a potential timing-related security issue. The UI can be instructed to open a new tab and show a dialog roughly at the same time, and since it's handled asynchronously the dialog may end up in front of the new tab. Knowing what web contents issued the dialog would allow us to prevent that from happening.
BUG=428793
Review URL: https://codereview.chromium.org/691823002
Cr-Commit-Position: refs/heads/master@{#304781}
Diffstat (limited to 'content/public/browser/web_contents_delegate.h')
-rw-r--r-- | content/public/browser/web_contents_delegate.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/content/public/browser/web_contents_delegate.h b/content/public/browser/web_contents_delegate.h index bcd5caf..92c8dcd 100644 --- a/content/public/browser/web_contents_delegate.h +++ b/content/public/browser/web_contents_delegate.h @@ -176,7 +176,7 @@ class CONTENT_EXPORT WebContentsDelegate { // Returns true if javascript dialogs and unload alerts are suppressed. // Default is false. - virtual bool ShouldSuppressDialogs(); + virtual bool ShouldSuppressDialogs(WebContents* source); // Returns whether pending NavigationEntries for aborted browser-initiated // navigations should be preserved (and thus returned from GetVisibleURL). @@ -342,7 +342,8 @@ class CONTENT_EXPORT WebContentsDelegate { // Returns a pointer to a service to manage JavaScript dialogs. May return // NULL in which case dialogs aren't shown. - virtual JavaScriptDialogManager* GetJavaScriptDialogManager(); + virtual JavaScriptDialogManager* GetJavaScriptDialogManager( + WebContents* source); // Called when color chooser should open. Returns the opened color chooser. // Returns NULL if we failed to open the color chooser (e.g. when there is a |