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

Unified Diff: chrome/renderer/mock_printer.cc

Issue 9705084: Block printing from blocked popup. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix init order 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/renderer/mock_printer.h ('k') | chrome/renderer/print_web_view_helper.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/mock_printer.cc
diff --git a/chrome/renderer/mock_printer.cc b/chrome/renderer/mock_printer.cc
index 949e588d74b3117daf9f1284859d0e958555474c..42ed001a5dd956365556f5f7a11eaf9a28f89a1a 100644
--- a/chrome/renderer/mock_printer.cc
+++ b/chrome/renderer/mock_printer.cc
@@ -69,6 +69,7 @@ MockPrinter::MockPrinter()
date_(ASCIIToUTF16("date")),
title_(ASCIIToUTF16("title")),
url_(ASCIIToUTF16("url")),
+ scripted_print_allowed_(true),
use_invalid_settings_(false) {
page_size_.SetSize(static_cast<int>(8.5 * dpi_),
static_cast<int>(11.0 * dpi_));
@@ -100,6 +101,10 @@ void MockPrinter::GetDefaultPrintSettings(PrintMsg_Print_Params* params) {
SetPrintParams(params);
}
+void MockPrinter::OnCheckScriptedPrintAllowed(bool* allowed) {
+ *allowed = scripted_print_allowed_;
+}
+
void MockPrinter::SetDefaultPrintSettings(const PrintMsg_Print_Params& params) {
dpi_ = params.dpi;
max_shrink_ = params.max_shrink;
@@ -123,6 +128,10 @@ void MockPrinter::UseInvalidSettings() {
SetDefaultPrintSettings(empty_param);
}
+void MockPrinter::SetScriptedPrintAllowed(bool allowed) {
+ scripted_print_allowed_ = allowed;
+}
+
void MockPrinter::UseInvalidPageSize() {
page_size_.SetSize(0, 0);
}
« no previous file with comments | « chrome/renderer/mock_printer.h ('k') | chrome/renderer/print_web_view_helper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698