OLD | NEW |
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/out_of_process_instance.h" | 5 #include "pdf/out_of_process_instance.h" |
6 | 6 |
7 #include <algorithm> // for min/max() | 7 #include <algorithm> // for min/max() |
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 584 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
595 if (print_settings_.print_pages_called_) | 595 if (print_settings_.print_pages_called_) |
596 UserMetricsRecordAction("PDF.PrintPage"); | 596 UserMetricsRecordAction("PDF.PrintPage"); |
597 print_settings_.Clear(); | 597 print_settings_.Clear(); |
598 engine_->PrintEnd(); | 598 engine_->PrintEnd(); |
599 } | 599 } |
600 | 600 |
601 bool OutOfProcessInstance::IsPrintScalingDisabled() { | 601 bool OutOfProcessInstance::IsPrintScalingDisabled() { |
602 return !engine_->GetPrintScaling(); | 602 return !engine_->GetPrintScaling(); |
603 } | 603 } |
604 | 604 |
| 605 int32_t OutOfProcessInstance::GetNumCopies() { |
| 606 return engine_->GetNumCopies(); |
| 607 } |
| 608 |
605 bool OutOfProcessInstance::StartFind(const std::string& text, | 609 bool OutOfProcessInstance::StartFind(const std::string& text, |
606 bool case_sensitive) { | 610 bool case_sensitive) { |
607 engine_->StartFind(text.c_str(), case_sensitive); | 611 engine_->StartFind(text.c_str(), case_sensitive); |
608 return true; | 612 return true; |
609 } | 613 } |
610 | 614 |
611 void OutOfProcessInstance::SelectFindResult(bool forward) { | 615 void OutOfProcessInstance::SelectFindResult(bool forward) { |
612 engine_->SelectFindResult(forward); | 616 engine_->SelectFindResult(forward); |
613 } | 617 } |
614 | 618 |
(...skipping 802 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1417 pp::Point OutOfProcessInstance::BoundScrollOffsetToDocument( | 1421 pp::Point OutOfProcessInstance::BoundScrollOffsetToDocument( |
1418 const pp::Point& scroll_offset) { | 1422 const pp::Point& scroll_offset) { |
1419 int max_x = document_size_.width() * zoom_ - plugin_dip_size_.width(); | 1423 int max_x = document_size_.width() * zoom_ - plugin_dip_size_.width(); |
1420 int x = std::max(std::min(scroll_offset.x(), max_x), 0); | 1424 int x = std::max(std::min(scroll_offset.x(), max_x), 0); |
1421 int max_y = document_size_.height() * zoom_ - plugin_dip_size_.height(); | 1425 int max_y = document_size_.height() * zoom_ - plugin_dip_size_.height(); |
1422 int y = std::max(std::min(scroll_offset.y(), max_y), 0); | 1426 int y = std::max(std::min(scroll_offset.y(), max_y), 0); |
1423 return pp::Point(x, y); | 1427 return pp::Point(x, y); |
1424 } | 1428 } |
1425 | 1429 |
1426 } // namespace chrome_pdf | 1430 } // namespace chrome_pdf |
OLD | NEW |