diff options
author | jcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-02-23 21:38:06 +0000 |
---|---|---|
committer | jcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-02-23 21:38:06 +0000 |
commit | 7d99a86a9ea01a007152ae240dc58df062e19662 (patch) | |
tree | 0427fad6c7e3f55d82fdec5ee1300d5025fa7214 /chrome/browser/extensions/extension_host.cc | |
parent | e48739a659dbe066dc4352355d4332eec63ad703 (diff) | |
download | chromium_src-7d99a86a9ea01a007152ae240dc58df062e19662.zip chromium_src-7d99a86a9ea01a007152ae240dc58df062e19662.tar.gz chromium_src-7d99a86a9ea01a007152ae240dc58df062e19662.tar.bz2 |
Displaying a JavaScript message box (such as an alert) from
an extension popup was causing the popup to lose focus and
be dismissed, causing other problems.
This CL fixes it on Windows with the following:
- the message box is now parented to the popup, not the tab
- the popup is not disimissed when losing focus to a window for
which it is the owner.
BUG=29147
TEST=Create an extension with a popup that contains a combo-box
and a button to show an alert and confirm box. Click on the
combobox and select an item. Click the button to show the
alert and confirm message box. The popup should not be closed
when you do that.
Review URL: http://codereview.chromium.org/650045
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@39770 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/extensions/extension_host.cc')
-rw-r--r-- | chrome/browser/extensions/extension_host.cc | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/chrome/browser/extensions/extension_host.cc b/chrome/browser/extensions/extension_host.cc index 4d930cf..e9fb5c4 100644 --- a/chrome/browser/extensions/extension_host.cc +++ b/chrome/browser/extensions/extension_host.cc @@ -12,6 +12,7 @@ #include "base/message_loop.h" #include "base/singleton.h" #include "base/string_util.h" +#include "chrome/common/platform_util.h" #include "chrome/browser/browser.h" #include "chrome/browser/browser_list.h" #include "chrome/browser/browser_shutdown.h" @@ -437,10 +438,7 @@ std::wstring ExtensionHost::GetMessageBoxTitle(const GURL& frame_url, } gfx::NativeWindow ExtensionHost::GetMessageBoxRootWindow() { - TabContents* active_tab = GetBrowser()->GetSelectedTabContents(); - if (active_tab) - return active_tab->view()->GetTopLevelNativeWindow(); - return NULL; + return platform_util::GetTopLevel(GetNativeViewOfHost()); } void ExtensionHost::OnMessageBoxClosed(IPC::Message* reply_msg, |