diff options
author | rafaelw@chromium.org <rafaelw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-24 00:19:54 +0000 |
---|---|---|
committer | rafaelw@chromium.org <rafaelw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-24 00:19:54 +0000 |
commit | 66bd33dbf76732655a7d5b156b895e78274ea1bc (patch) | |
tree | 79c13921ae5b0f3a5e6e56bdba73fe5402453e56 /chrome/browser/app_modal_dialog.h | |
parent | 489853ce6239d4333923c6f4d7a1d6ae0284fe88 (diff) | |
download | chromium_src-66bd33dbf76732655a7d5b156b895e78274ea1bc.zip chromium_src-66bd33dbf76732655a7d5b156b895e78274ea1bc.tar.gz chromium_src-66bd33dbf76732655a7d5b156b895e78274ea1bc.tar.bz2 |
Fix crash when an extension popup shows a JS alert. Showing the alert takes...
Landing this on for pam. Original issue: http://codereview.chromium.org/425011/show.
Disable showing JS alerts from popups, because doing so makes the popup
disappear immediately, which has all sorts of unfortunate side effects for the
poor orphaned alert (see bug for details).
BUG=27758
TEST=create extension with popup, put link with |onclick="alert('test');"| in
it; install extension, open popup, and click link; see no crash (nor popup)
Review URL: http://codereview.chromium.org/435010
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@32889 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/app_modal_dialog.h')
-rw-r--r-- | chrome/browser/app_modal_dialog.h | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/chrome/browser/app_modal_dialog.h b/chrome/browser/app_modal_dialog.h index a58981c..b3885c3 100644 --- a/chrome/browser/app_modal_dialog.h +++ b/chrome/browser/app_modal_dialog.h @@ -21,6 +21,7 @@ typedef GtkWidget* NativeDialog; typedef void* NativeDialog; #endif +class ExtensionHost; class JavaScriptMessageBoxClient; class TabContents; namespace IPC { @@ -96,8 +97,9 @@ class AppModalDialog : public NotificationObserver { const NotificationSource& source, const NotificationDetails& details); - // Sends APP_MODAL_DIALOG_CLOSED notification. - void SendCloseNotification(); + // Cleans up after the dialog closes for any reason: sends close + // notification and re-enables input events. + void Cleanup(); NotificationRegistrar registrar_; @@ -108,6 +110,13 @@ class AppModalDialog : public NotificationObserver { // and receive results. JavaScriptMessageBoxClient* client_; + // The client_ as an ExtensionHost, cached for use during notifications that + // may arrive after the client has entered its destructor (and is thus + // treated as a base JavaScriptMessageBoxClient). This will be NULL if the + // client is not an ExtensionHost. + TabContents* tab_contents_; + ExtensionHost* extension_host_; + // True if the dialog should no longer be shown, e.g. because the underlying // tab navigated away while the dialog was queued. bool skip_this_dialog_; |