| 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/pdfium/pdfium_engine.h" | 5 #include "pdf/pdfium/pdfium_engine.h" |
| 6 | 6 |
| 7 #include <math.h> | 7 #include <math.h> |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| (...skipping 2281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2292 if (center.x() < visible_rect.x() || center.x() > visible_rect.right()) { | 2292 if (center.x() < visible_rect.x() || center.x() > visible_rect.right()) { |
| 2293 int new_x = static_cast<int>(center.x() * current_zoom_) - | 2293 int new_x = static_cast<int>(center.x() * current_zoom_) - |
| 2294 static_cast<int>(visible_rect.width() * current_zoom_ / 2); | 2294 static_cast<int>(visible_rect.width() * current_zoom_ / 2); |
| 2295 if (new_x < 0) | 2295 if (new_x < 0) |
| 2296 new_x = 0; | 2296 new_x = 0; |
| 2297 client_->ScrollToX(new_x); | 2297 client_->ScrollToX(new_x); |
| 2298 } | 2298 } |
| 2299 } | 2299 } |
| 2300 | 2300 |
| 2301 client_->NotifySelectedFindResultChanged(current_find_index_.GetIndex()); | 2301 client_->NotifySelectedFindResultChanged(current_find_index_.GetIndex()); |
| 2302 client_->NotifyNumberOfFindResultsChanged(find_results_.size(), true); |
| 2302 return true; | 2303 return true; |
| 2303 } | 2304 } |
| 2304 | 2305 |
| 2305 void PDFiumEngine::StopFind() { | 2306 void PDFiumEngine::StopFind() { |
| 2306 SelectionChangeInvalidator selection_invalidator(this); | 2307 SelectionChangeInvalidator selection_invalidator(this); |
| 2307 | 2308 |
| 2308 selection_.clear(); | 2309 selection_.clear(); |
| 2309 selecting_ = false; | 2310 selecting_ = false; |
| 2310 find_results_.clear(); | 2311 find_results_.clear(); |
| 2311 next_page_to_search_ = -1; | 2312 next_page_to_search_ = -1; |
| (...skipping 1870 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4182 FPDF_DOCUMENT doc = | 4183 FPDF_DOCUMENT doc = |
| 4183 FPDF_LoadMemDocument(pdf_buffer, pdf_buffer_size, nullptr); | 4184 FPDF_LoadMemDocument(pdf_buffer, pdf_buffer_size, nullptr); |
| 4184 if (!doc) | 4185 if (!doc) |
| 4185 return false; | 4186 return false; |
| 4186 bool success = FPDF_GetPageSizeByIndex(doc, page_number, width, height) != 0; | 4187 bool success = FPDF_GetPageSizeByIndex(doc, page_number, width, height) != 0; |
| 4187 FPDF_CloseDocument(doc); | 4188 FPDF_CloseDocument(doc); |
| 4188 return success; | 4189 return success; |
| 4189 } | 4190 } |
| 4190 | 4191 |
| 4191 } // namespace chrome_pdf | 4192 } // namespace chrome_pdf |
| OLD | NEW |