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

Side by Side Diff: pdf/instance.cc

Issue 691273003: PDF: Fix potential bad indexes in find results. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: self review Created 6 years, 1 month 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
« no previous file with comments | « no previous file | pdf/out_of_process_instance.cc » ('j') | pdf/pdfium/pdfium_engine.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/instance.h" 5 #include "pdf/instance.h"
6 6
7 #include <algorithm> // for min() 7 #include <algorithm> // for min()
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 1267 matching lines...) Expand 10 before | Expand all | Expand 10 after
1278 1278
1279 v_scrollbar_->SetTickMarks( 1279 v_scrollbar_->SetTickMarks(
1280 scaled_tickmarks.empty() ? NULL : &scaled_tickmarks[0], tickmarks.size()); 1280 scaled_tickmarks.empty() ? NULL : &scaled_tickmarks[0], tickmarks.size());
1281 } 1281 }
1282 1282
1283 void Instance::NotifyNumberOfFindResultsChanged(int total, bool final_result) { 1283 void Instance::NotifyNumberOfFindResultsChanged(int total, bool final_result) {
1284 NumberOfFindResultsChanged(total, final_result); 1284 NumberOfFindResultsChanged(total, final_result);
1285 } 1285 }
1286 1286
1287 void Instance::NotifySelectedFindResultChanged(int current_find_index) { 1287 void Instance::NotifySelectedFindResultChanged(int current_find_index) {
1288 DCHECK_GE(current_find_index, 0);
1288 SelectedFindResultChanged(current_find_index); 1289 SelectedFindResultChanged(current_find_index);
1289 } 1290 }
1290 1291
1291 void Instance::OnEvent(uint32 control_id, uint32 event_id, void* data) { 1292 void Instance::OnEvent(uint32 control_id, uint32 event_id, void* data) {
1292 if (event_id == Button::EVENT_ID_BUTTON_CLICKED || 1293 if (event_id == Button::EVENT_ID_BUTTON_CLICKED ||
1293 event_id == Button::EVENT_ID_BUTTON_STATE_CHANGED) { 1294 event_id == Button::EVENT_ID_BUTTON_STATE_CHANGED) {
1294 switch (control_id) { 1295 switch (control_id) {
1295 case kFitToPageButtonId: 1296 case kFitToPageButtonId:
1296 UserMetricsRecordAction("PDF.FitToPageButton"); 1297 UserMetricsRecordAction("PDF.FitToPageButton");
1297 SetZoom(ZOOM_FIT_TO_PAGE, 0); 1298 SetZoom(ZOOM_FIT_TO_PAGE, 0);
(...skipping 1471 matching lines...) Expand 10 before | Expand all | Expand 10 after
2769 return instance_->HasScriptableMethod(name, exception); 2770 return instance_->HasScriptableMethod(name, exception);
2770 } 2771 }
2771 2772
2772 pp::Var PDFScriptableObject::Call(const pp::Var& method, 2773 pp::Var PDFScriptableObject::Call(const pp::Var& method,
2773 const std::vector<pp::Var>& args, 2774 const std::vector<pp::Var>& args,
2774 pp::Var* exception) { 2775 pp::Var* exception) {
2775 return instance_->CallScriptableMethod(method, args, exception); 2776 return instance_->CallScriptableMethod(method, args, exception);
2776 } 2777 }
2777 2778
2778 } // namespace chrome_pdf 2779 } // namespace chrome_pdf
OLDNEW
« no previous file with comments | « no previous file | pdf/out_of_process_instance.cc » ('j') | pdf/pdfium/pdfium_engine.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698