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/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 1268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1279 | 1279 |
1280 v_scrollbar_->SetTickMarks( | 1280 v_scrollbar_->SetTickMarks( |
1281 scaled_tickmarks.empty() ? NULL : &scaled_tickmarks[0], tickmarks.size()); | 1281 scaled_tickmarks.empty() ? NULL : &scaled_tickmarks[0], tickmarks.size()); |
1282 } | 1282 } |
1283 | 1283 |
1284 void Instance::NotifyNumberOfFindResultsChanged(int total, bool final_result) { | 1284 void Instance::NotifyNumberOfFindResultsChanged(int total, bool final_result) { |
1285 NumberOfFindResultsChanged(total, final_result); | 1285 NumberOfFindResultsChanged(total, final_result); |
1286 } | 1286 } |
1287 | 1287 |
1288 void Instance::NotifySelectedFindResultChanged(int current_find_index) { | 1288 void Instance::NotifySelectedFindResultChanged(int current_find_index) { |
| 1289 DCHECK_GE(current_find_index, 0); |
1289 SelectedFindResultChanged(current_find_index); | 1290 SelectedFindResultChanged(current_find_index); |
1290 } | 1291 } |
1291 | 1292 |
1292 void Instance::OnEvent(uint32 control_id, uint32 event_id, void* data) { | 1293 void Instance::OnEvent(uint32 control_id, uint32 event_id, void* data) { |
1293 if (event_id == Button::EVENT_ID_BUTTON_CLICKED || | 1294 if (event_id == Button::EVENT_ID_BUTTON_CLICKED || |
1294 event_id == Button::EVENT_ID_BUTTON_STATE_CHANGED) { | 1295 event_id == Button::EVENT_ID_BUTTON_STATE_CHANGED) { |
1295 switch (control_id) { | 1296 switch (control_id) { |
1296 case kFitToPageButtonId: | 1297 case kFitToPageButtonId: |
1297 UserMetricsRecordAction("PDF.FitToPageButton"); | 1298 UserMetricsRecordAction("PDF.FitToPageButton"); |
1298 SetZoom(ZOOM_FIT_TO_PAGE, 0); | 1299 SetZoom(ZOOM_FIT_TO_PAGE, 0); |
(...skipping 1471 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2770 return instance_->HasScriptableMethod(name, exception); | 2771 return instance_->HasScriptableMethod(name, exception); |
2771 } | 2772 } |
2772 | 2773 |
2773 pp::Var PDFScriptableObject::Call(const pp::Var& method, | 2774 pp::Var PDFScriptableObject::Call(const pp::Var& method, |
2774 const std::vector<pp::Var>& args, | 2775 const std::vector<pp::Var>& args, |
2775 pp::Var* exception) { | 2776 pp::Var* exception) { |
2776 return instance_->CallScriptableMethod(method, args, exception); | 2777 return instance_->CallScriptableMethod(method, args, exception); |
2777 } | 2778 } |
2778 | 2779 |
2779 } // namespace chrome_pdf | 2780 } // namespace chrome_pdf |
OLD | NEW |