| 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 646 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 657 UserMetricsRecordAction("PDF.PrintPage"); | 657 UserMetricsRecordAction("PDF.PrintPage"); |
| 658 print_settings_.Clear(); | 658 print_settings_.Clear(); |
| 659 engine_->PrintEnd(); | 659 engine_->PrintEnd(); |
| 660 } | 660 } |
| 661 | 661 |
| 662 bool OutOfProcessInstance::IsPrintScalingDisabled() { | 662 bool OutOfProcessInstance::IsPrintScalingDisabled() { |
| 663 return !engine_->GetPrintScaling(); | 663 return !engine_->GetPrintScaling(); |
| 664 } | 664 } |
| 665 | 665 |
| 666 bool OutOfProcessInstance::StartFind(const std::string& text, | 666 bool OutOfProcessInstance::StartFind(const std::string& text, |
| 667 bool case_sensitive) { | 667 bool case_sensitive) { |
| 668 engine_->StartFind(text.c_str(), case_sensitive); | 668 engine_->StartFind(text, case_sensitive); |
| 669 return true; | 669 return true; |
| 670 } | 670 } |
| 671 | 671 |
| 672 void OutOfProcessInstance::SelectFindResult(bool forward) { | 672 void OutOfProcessInstance::SelectFindResult(bool forward) { |
| 673 engine_->SelectFindResult(forward); | 673 engine_->SelectFindResult(forward); |
| 674 } | 674 } |
| 675 | 675 |
| 676 void OutOfProcessInstance::StopFind() { | 676 void OutOfProcessInstance::StopFind() { |
| 677 engine_->StopFind(); | 677 engine_->StopFind(); |
| 678 tickmarks_.clear(); | 678 tickmarks_.clear(); |
| (...skipping 754 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1433 const pp::FloatPoint& scroll_offset) { | 1433 const pp::FloatPoint& scroll_offset) { |
| 1434 float max_x = document_size_.width() * zoom_ - plugin_dip_size_.width(); | 1434 float max_x = document_size_.width() * zoom_ - plugin_dip_size_.width(); |
| 1435 float x = std::max(std::min(scroll_offset.x(), max_x), 0.0f); | 1435 float x = std::max(std::min(scroll_offset.x(), max_x), 0.0f); |
| 1436 float min_y = -top_toolbar_height_; | 1436 float min_y = -top_toolbar_height_; |
| 1437 float max_y = document_size_.height() * zoom_ - plugin_dip_size_.height(); | 1437 float max_y = document_size_.height() * zoom_ - plugin_dip_size_.height(); |
| 1438 float y = std::max(std::min(scroll_offset.y(), max_y), min_y); | 1438 float y = std::max(std::min(scroll_offset.y(), max_y), min_y); |
| 1439 return pp::FloatPoint(x, y); | 1439 return pp::FloatPoint(x, y); |
| 1440 } | 1440 } |
| 1441 | 1441 |
| 1442 } // namespace chrome_pdf | 1442 } // namespace chrome_pdf |
| OLD | NEW |