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

Side by Side Diff: pdf/instance.cc

Issue 974183003: Print Preview: Support the duplex preset in PDFs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: tsepez comments Created 5 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 unified diff | Download patch
« no previous file with comments | « content/renderer/pepper/pepper_plugin_instance_impl.cc ('k') | pdf/out_of_process_instance.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "pdf/instance.h" 5 #include "pdf/instance.h"
6 6
7 #include <algorithm> // for min() 7 #include <algorithm> // for min()
8 #define _USE_MATH_DEFINES // for M_PI 8 #define _USE_MATH_DEFINES // for M_PI
9 #include <cmath> // for log() and pow() 9 #include <cmath> // for log() and pow()
10 #include <math.h> 10 #include <math.h>
(...skipping 656 matching lines...) Expand 10 before | Expand all | Expand 10 after
667 // The pp::Var takes ownership of object here. 667 // The pp::Var takes ownership of object here.
668 instance_object_ = pp::VarPrivate(this, object); 668 instance_object_ = pp::VarPrivate(this, object);
669 } 669 }
670 670
671 return instance_object_; 671 return instance_object_;
672 } 672 }
673 673
674 void Instance::GetPrintPresetOptionsFromDocument( 674 void Instance::GetPrintPresetOptionsFromDocument(
675 PP_PdfPrintPresetOptions_Dev* options) { 675 PP_PdfPrintPresetOptions_Dev* options) {
676 options->is_scaling_disabled = PP_FromBool(IsPrintScalingDisabled()); 676 options->is_scaling_disabled = PP_FromBool(IsPrintScalingDisabled());
677 options->duplex =
678 static_cast<PP_PrivateDuplexMode_Dev>(engine_->GetDuplexType());
677 options->copies = engine_->GetCopiesToPrint(); 679 options->copies = engine_->GetCopiesToPrint();
678 } 680 }
679 681
680 pp::Var Instance::GetLinkAtPosition(const pp::Point& point) { 682 pp::Var Instance::GetLinkAtPosition(const pp::Point& point) {
681 pp::Point offset_point(point); 683 pp::Point offset_point(point);
682 ScalePoint(device_scale_, &offset_point); 684 ScalePoint(device_scale_, &offset_point);
683 offset_point.set_x(offset_point.x() - available_area_.x()); 685 offset_point.set_x(offset_point.x() - available_area_.x());
684 return engine_->GetLinkAtPosition(offset_point); 686 return engine_->GetLinkAtPosition(offset_point);
685 } 687 }
686 688
(...skipping 2131 matching lines...) Expand 10 before | Expand all | Expand 10 after
2818 return instance_->HasScriptableMethod(name, exception); 2820 return instance_->HasScriptableMethod(name, exception);
2819 } 2821 }
2820 2822
2821 pp::Var PDFScriptableObject::Call(const pp::Var& method, 2823 pp::Var PDFScriptableObject::Call(const pp::Var& method,
2822 const std::vector<pp::Var>& args, 2824 const std::vector<pp::Var>& args,
2823 pp::Var* exception) { 2825 pp::Var* exception) {
2824 return instance_->CallScriptableMethod(method, args, exception); 2826 return instance_->CallScriptableMethod(method, args, exception);
2825 } 2827 }
2826 2828
2827 } // namespace chrome_pdf 2829 } // namespace chrome_pdf
OLDNEW
« no previous file with comments | « content/renderer/pepper/pepper_plugin_instance_impl.cc ('k') | pdf/out_of_process_instance.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698