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

Side by Side Diff: pdf/out_of_process_instance.cc

Issue 1365563003: Prevent guest views from issuing a search for empty text. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: lint Created 5 years, 2 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
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/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 638 matching lines...) Expand 10 before | Expand all | Expand 10 after
649 UserMetricsRecordAction("PDF.PrintPage"); 649 UserMetricsRecordAction("PDF.PrintPage");
650 print_settings_.Clear(); 650 print_settings_.Clear();
651 engine_->PrintEnd(); 651 engine_->PrintEnd();
652 } 652 }
653 653
654 bool OutOfProcessInstance::IsPrintScalingDisabled() { 654 bool OutOfProcessInstance::IsPrintScalingDisabled() {
655 return !engine_->GetPrintScaling(); 655 return !engine_->GetPrintScaling();
656 } 656 }
657 657
658 bool OutOfProcessInstance::StartFind(const std::string& text, 658 bool OutOfProcessInstance::StartFind(const std::string& text,
659 bool case_sensitive) { 659 bool case_sensitive) {
660 engine_->StartFind(text.c_str(), case_sensitive); 660 engine_->StartFind(text, case_sensitive);
661 return true; 661 return true;
662 } 662 }
663 663
664 void OutOfProcessInstance::SelectFindResult(bool forward) { 664 void OutOfProcessInstance::SelectFindResult(bool forward) {
665 engine_->SelectFindResult(forward); 665 engine_->SelectFindResult(forward);
666 } 666 }
667 667
668 void OutOfProcessInstance::StopFind() { 668 void OutOfProcessInstance::StopFind() {
669 engine_->StopFind(); 669 engine_->StopFind();
670 tickmarks_.clear(); 670 tickmarks_.clear();
(...skipping 745 matching lines...) Expand 10 before | Expand all | Expand 10 after
1416 const pp::FloatPoint& scroll_offset) { 1416 const pp::FloatPoint& scroll_offset) {
1417 float max_x = document_size_.width() * zoom_ - plugin_dip_size_.width(); 1417 float max_x = document_size_.width() * zoom_ - plugin_dip_size_.width();
1418 float x = std::max(std::min(scroll_offset.x(), max_x), 0.0f); 1418 float x = std::max(std::min(scroll_offset.x(), max_x), 0.0f);
1419 float min_y = -top_toolbar_height_; 1419 float min_y = -top_toolbar_height_;
1420 float max_y = document_size_.height() * zoom_ - plugin_dip_size_.height(); 1420 float max_y = document_size_.height() * zoom_ - plugin_dip_size_.height();
1421 float y = std::max(std::min(scroll_offset.y(), max_y), min_y); 1421 float y = std::max(std::min(scroll_offset.y(), max_y), min_y);
1422 return pp::FloatPoint(x, y); 1422 return pp::FloatPoint(x, y);
1423 } 1423 }
1424 1424
1425 } // namespace chrome_pdf 1425 } // namespace chrome_pdf
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698