summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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;