summaryrefslogtreecommitdiffstats
path: root/chrome/browser/jsmessage_box_client.h
diff options
context:
space:
mode:
authorrafaelw@chromium.org <rafaelw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-24 00:19:54 +0000
committerrafaelw@chromium.org <rafaelw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-24 00:19:54 +0000
commit66bd33dbf76732655a7d5b156b895e78274ea1bc (patch)
tree79c13921ae5b0f3a5e6e56bdba73fe5402453e56 /chrome/browser/jsmessage_box_client.h
parent489853ce6239d4333923c6f4d7a1d6ae0284fe88 (diff)
downloadchromium_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/jsmessage_box_client.h')
-rw-r--r--chrome/browser/jsmessage_box_client.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/chrome/browser/jsmessage_box_client.h b/chrome/browser/jsmessage_box_client.h
index a370445..169805c 100644
--- a/chrome/browser/jsmessage_box_client.h
+++ b/chrome/browser/jsmessage_box_client.h
@@ -15,6 +15,7 @@
#include "app/gfx/native_widget_types.h"
+class ExtensionHost;
class GURL;
class Profile;
class TabContents;
@@ -41,10 +42,12 @@ class JavaScriptMessageBoxClient {
// Indicates whether additional message boxes should be suppressed.
virtual void SetSuppressMessageBoxes(bool suppress_message_boxes) = 0;
- // Returns the TabContents associated with this message box -- in practice,
- // the TabContents implementing this interface -- or NULL if it has no
- // TabContents (e.g., it's an ExtensionHost).
+ // Returns the TabContents or ExtensionHost associated with this message
+ // box -- in practice, the object implementing this interface. Exactly one of
+ // these must be non-NULL; behavior is undefined (read: it'll probably crash)
+ // if that is not the case.
virtual TabContents* AsTabContents() = 0;
+ virtual ExtensionHost* AsExtensionHost() = 0;
};
#endif // CHROME_BROWSER_JSMESSAGE_BOX_CLIENT_H_