summaryrefslogtreecommitdiffstats
path: root/chrome/service/service_utility_process_host.h
diff options
context:
space:
mode:
authorgene@chromium.org <gene@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-01-28 00:56:43 +0000
committergene@chromium.org <gene@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-01-28 00:56:43 +0000
commit1a30dd3972674b1dd27aa956c7846a1fa5ea5909 (patch)
tree75c71f532b1aba3e2b7a046ebe631263d15dab33 /chrome/service/service_utility_process_host.h
parentc8b657f0e1b1d63cc0c945b32d3e3599b13c72be (diff)
downloadchromium_src-1a30dd3972674b1dd27aa956c7846a1fa5ea5909.zip
chromium_src-1a30dd3972674b1dd27aa956c7846a1fa5ea5909.tar.gz
chromium_src-1a30dd3972674b1dd27aa956c7846a1fa5ea5909.tar.bz2
Fixed printing gets cut-off issue for CloudPrint and Chrome.
Background: Print output is rendering to metafile that is based on the screen DC. The metafile was scaled to 72/600 for Chrome printing and 96/600 for CloudPrint. When the resolution of the screen is low and print output is large, it is possible for metafile output to go outside of the boundaries and be cut-off the print out. Fix: This CL calculates scaling dynamically based on the printer and metafile sizes and revert scaling correspondingly in the browser/service for the actual printout. BUG=chromium-os:16088 TEST=Verify Chrome and CloudPrint printing is working fine. Lower screen resolution (to 800x600 for Chrome, for CloudPrint it is enough to lower to 1280x800). Run Chrome and enable CloudPrint support. Try printing files from the bug 16088. Review URL: http://codereview.chromium.org/9288081 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@119546 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/service/service_utility_process_host.h')
-rw-r--r--chrome/service/service_utility_process_host.h11
1 files changed, 7 insertions, 4 deletions
diff --git a/chrome/service/service_utility_process_host.h b/chrome/service/service_utility_process_host.h
index 3fb3a45..153b988 100644
--- a/chrome/service/service_utility_process_host.h
+++ b/chrome/service/service_utility_process_host.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -56,7 +56,8 @@ class ServiceUtilityProcessHost : public content::ChildProcessHostDelegate {
// successfully into |metafile|.
virtual void OnRenderPDFPagesToMetafileSucceeded(
const printing::Emf& metafile,
- int highest_rendered_page_number) {}
+ int highest_rendered_page_number,
+ double scale_factor) {}
// Called when no page in the passed in PDF could be rendered.
virtual void OnRenderPDFPagesToMetafileFailed() {}
@@ -80,7 +81,8 @@ class ServiceUtilityProcessHost : public content::ChildProcessHostDelegate {
// Invoked when a metafile file is ready.
void MetafileAvailable(const FilePath& metafile_path,
- int highest_rendered_page_number);
+ int highest_rendered_page_number,
+ double scale_factor);
DISALLOW_COPY_AND_ASSIGN(Client);
};
@@ -128,7 +130,8 @@ class ServiceUtilityProcessHost : public content::ChildProcessHostDelegate {
base::ProcessHandle handle() const { return handle_; }
// Messages handlers:
- void OnRenderPDFPagesToMetafileSucceeded(int highest_rendered_page_number);
+ void OnRenderPDFPagesToMetafileSucceeded(int highest_rendered_page_number,
+ double scale_factor);
void OnRenderPDFPagesToMetafileFailed();
void OnGetPrinterCapsAndDefaultsSucceeded(
const std::string& printer_name,