Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4027)

Unified Diff: chrome/browser/ui/blocked_content/blocked_content_tab_helper.cc

Issue 9762004: Block scripted printing. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/printing/print_view_manager.cc ('k') | chrome/common/print_messages.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/blocked_content/blocked_content_tab_helper.cc
===================================================================
--- chrome/browser/ui/blocked_content/blocked_content_tab_helper.cc (revision 127745)
+++ chrome/browser/ui/blocked_content/blocked_content_tab_helper.cc (working copy)
@@ -7,6 +7,7 @@
#include "base/auto_reset.h"
#include "chrome/browser/content_settings/host_content_settings_map.h"
#include "chrome/browser/content_settings/tab_specific_content_settings.h"
+#include "chrome/browser/printing/print_view_manager.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/blocked_content/blocked_content_container.h"
#include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h"
@@ -59,8 +60,10 @@
if (!all_contents_blocked_ && blocked_contents_->GetBlockedContentsCount()) {
std::vector<TabContentsWrapper*> blocked;
blocked_contents_->GetBlockedContents(&blocked);
- for (size_t i = 0; i < blocked.size(); ++i)
+ for (size_t i = 0; i < blocked.size(); ++i) {
+ blocked[i]->print_view_manager()->SetScriptedPrintingBlocked(false);
blocked_contents_->LaunchForContents(blocked[i]);
+ }
}
}
@@ -70,6 +73,7 @@
bool user_gesture) {
if (!blocked_contents_->GetBlockedContentsCount())
PopupNotificationVisibilityChanged(true);
+ new_contents->print_view_manager()->SetScriptedPrintingBlocked(true);
blocked_contents_->AddTabContents(
new_contents, disposition, initial_pos, user_gesture);
}
@@ -103,6 +107,7 @@
} else {
// Call blocked_contents_->AddTabContents with user_gesture == true
// so that the contents will not get blocked again.
+ new_contents->print_view_manager()->SetScriptedPrintingBlocked(true);
blocked_contents_->AddTabContents(new_contents,
NEW_POPUP,
initial_pos,
@@ -114,6 +119,7 @@
void BlockedContentTabHelper::LaunchForContents(
TabContentsWrapper* tab_contents) {
+ tab_contents->print_view_manager()->SetScriptedPrintingBlocked(false);
blocked_contents_->LaunchForContents(tab_contents);
if (!blocked_contents_->GetBlockedContentsCount())
PopupNotificationVisibilityChanged(false);
« no previous file with comments | « chrome/browser/printing/print_view_manager.cc ('k') | chrome/common/print_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698