| 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::GetCopiesToPrint() { |
| 606 return engine_->GetCopiesToPrint(); |
| 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 803 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1418 pp::Point OutOfProcessInstance::BoundScrollOffsetToDocument( | 1422 pp::Point OutOfProcessInstance::BoundScrollOffsetToDocument( |
| 1419 const pp::Point& scroll_offset) { | 1423 const pp::Point& scroll_offset) { |
| 1420 int max_x = document_size_.width() * zoom_ - plugin_dip_size_.width(); | 1424 int max_x = document_size_.width() * zoom_ - plugin_dip_size_.width(); |
| 1421 int x = std::max(std::min(scroll_offset.x(), max_x), 0); | 1425 int x = std::max(std::min(scroll_offset.x(), max_x), 0); |
| 1422 int max_y = document_size_.height() * zoom_ - plugin_dip_size_.height(); | 1426 int max_y = document_size_.height() * zoom_ - plugin_dip_size_.height(); |
| 1423 int y = std::max(std::min(scroll_offset.y(), max_y), 0); | 1427 int y = std::max(std::min(scroll_offset.y(), max_y), 0); |
| 1424 return pp::Point(x, y); | 1428 return pp::Point(x, y); |
| 1425 } | 1429 } |
| 1426 | 1430 |
| 1427 } // namespace chrome_pdf | 1431 } // namespace chrome_pdf |
| OLD | NEW |