summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorjnd@google.com <jnd@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-23 11:58:35 +0000
committerjnd@google.com <jnd@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-23 11:58:35 +0000
commit7ef03e00c0b4b0e6b1998a6a3d69fafb6d630f12 (patch)
tree5d7a016815fabffcccd85e54ff7916db29e7afd3 /chrome
parent38586e5b655a799bb20f872d107103112f04be30 (diff)
downloadchromium_src-7ef03e00c0b4b0e6b1998a6a3d69fafb6d630f12.zip
chromium_src-7ef03e00c0b4b0e6b1998a6a3d69fafb6d630f12.tar.gz
chromium_src-7ef03e00c0b4b0e6b1998a6a3d69fafb6d630f12.tar.bz2
Don't display the file select dialog from invisible windows.
See more details from http://code.google.com/p/chromium/issues/detail?id=58319. BUG=58319 TEST=none Review URL: http://codereview.chromium.org/3832005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@63647 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/blocked_content_container.cc5
-rw-r--r--chrome/renderer/render_view.cc3
2 files changed, 8 insertions, 0 deletions
diff --git a/chrome/browser/blocked_content_container.cc b/chrome/browser/blocked_content_container.cc
index 37767ca..bbe712a 100644
--- a/chrome/browser/blocked_content_container.cc
+++ b/chrome/browser/blocked_content_container.cc
@@ -47,6 +47,9 @@ void BlockedContentContainer::AddTabContents(TabContents* tab_contents,
blocked_contents_.push_back(
BlockedContent(tab_contents, disposition, bounds, user_gesture));
tab_contents->set_delegate(this);
+ // Since the new tab_contents will not be showed, call WasHidden to change
+ // its status on both RenderViewHost and RenderView.
+ tab_contents->WasHidden();
if (blocked_contents_.size() == 1)
owner_->PopupNotificationVisibilityChanged(true);
}
@@ -62,6 +65,8 @@ void BlockedContentContainer::LaunchForContents(TabContents* tab_contents) {
blocked_contents_.erase(i);
i = blocked_contents_.end();
tab_contents->set_delegate(NULL);
+ // We needn't call WasRestored to change its status because the
+ // TabContents::AddNewContents will do it.
owner_->AddNewContents(tab_contents, content.disposition, content.bounds,
content.user_gesture);
break;
diff --git a/chrome/renderer/render_view.cc b/chrome/renderer/render_view.cc
index baac89a..f9c017b 100644
--- a/chrome/renderer/render_view.cc
+++ b/chrome/renderer/render_view.cc
@@ -2086,6 +2086,9 @@ void RenderView::updateSpellingUIWithMisspelledWord(const WebString& word) {
bool RenderView::runFileChooser(
const WebKit::WebFileChooserParams& params,
WebFileChooserCompletion* chooser_completion) {
+ // Do not open the file dialog in a hidden RenderView.
+ if (is_hidden())
+ return false;
ViewHostMsg_RunFileChooser_Params ipc_params;
if (params.directory)
ipc_params.mode = ViewHostMsg_RunFileChooser_Params::OpenFolder;