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

Unified Diff: chrome/browser/printing/print_preview_message_handler.cc

Issue 10083060: [Print Preview]: Added code to support pdf fit to page functionality. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: '' Created 8 years, 8 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
Index: chrome/browser/printing/print_preview_message_handler.cc
diff --git a/chrome/browser/printing/print_preview_message_handler.cc b/chrome/browser/printing/print_preview_message_handler.cc
index 7dd0a962918fb5703d6c311177089ee659bc87e9..e7c8c25d90c120c94d40cacf27e144fb9156ecdc 100644
--- a/chrome/browser/printing/print_preview_message_handler.cc
+++ b/chrome/browser/printing/print_preview_message_handler.cc
@@ -24,6 +24,7 @@
#include "content/public/browser/web_ui.h"
#include "printing/page_size_margins.h"
#include "printing/print_job_constants.h"
+#include "ui/gfx/rect.h"
using content::BrowserThread;
using content::NavigationController;
@@ -214,6 +215,16 @@ void PrintPreviewMessageHandler::OnInvalidPrinterSettings(int document_cookie) {
print_preview_ui->OnInvalidPrinterSettings();
}
+void PrintPreviewMessageHandler::OnPrintPreviewScalingDisabled() {
+ TabContentsWrapper* print_preview_tab = GetPrintPreviewTab();
+ if (!print_preview_tab || !print_preview_tab->web_contents()->GetWebUI())
+ return;
+
+ PrintPreviewUI* print_preview_ui = static_cast<PrintPreviewUI*>(
+ print_preview_tab->web_contents()->GetWebUI()->GetController());
+ print_preview_ui->OnPrintPreviewScalingDisabled();
+}
+
bool PrintPreviewMessageHandler::OnMessageReceived(
const IPC::Message& message) {
bool handled = true;
@@ -234,6 +245,8 @@ bool PrintPreviewMessageHandler::OnMessageReceived(
OnPrintPreviewCancelled)
IPC_MESSAGE_HANDLER(PrintHostMsg_PrintPreviewInvalidPrinterSettings,
OnInvalidPrinterSettings)
+ IPC_MESSAGE_HANDLER(PrintHostMsg_PrintPreviewScalingDisabled,
+ OnPrintPreviewScalingDisabled)
IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP()
return handled;

Powered by Google App Engine
This is Rietveld 408576698