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> |
11 #include <list> | 11 #include <list> |
12 | 12 |
13 #include "base/json/json_reader.h" | 13 #include "base/json/json_reader.h" |
14 #include "base/json/json_writer.h" | 14 #include "base/json/json_writer.h" |
15 #include "base/logging.h" | 15 #include "base/logging.h" |
16 #include "base/strings/string_number_conversions.h" | 16 #include "base/strings/string_number_conversions.h" |
17 #include "base/strings/string_split.h" | 17 #include "base/strings/string_split.h" |
18 #include "base/strings/string_util.h" | 18 #include "base/strings/string_util.h" |
19 #include "base/values.h" | 19 #include "base/values.h" |
20 #include "chrome/common/content_restriction.h" | 20 #include "chrome/common/content_restriction.h" |
21 #include "net/base/escape.h" | 21 #include "net/base/escape.h" |
22 #include "pdf/draw_utils.h" | |
23 #include "pdf/pdf.h" | 22 #include "pdf/pdf.h" |
24 #include "ppapi/c/dev/ppb_cursor_control_dev.h" | 23 #include "ppapi/c/dev/ppb_cursor_control_dev.h" |
25 #include "ppapi/c/pp_errors.h" | 24 #include "ppapi/c/pp_errors.h" |
26 #include "ppapi/c/pp_rect.h" | 25 #include "ppapi/c/pp_rect.h" |
27 #include "ppapi/c/private/ppb_instance_private.h" | 26 #include "ppapi/c/private/ppb_instance_private.h" |
28 #include "ppapi/c/private/ppp_pdf.h" | 27 #include "ppapi/c/private/ppp_pdf.h" |
29 #include "ppapi/c/trusted/ppb_url_loader_trusted.h" | 28 #include "ppapi/c/trusted/ppb_url_loader_trusted.h" |
30 #include "ppapi/cpp/core.h" | 29 #include "ppapi/cpp/core.h" |
31 #include "ppapi/cpp/dev/memory_dev.h" | 30 #include "ppapi/cpp/dev/memory_dev.h" |
32 #include "ppapi/cpp/dev/text_input_dev.h" | 31 #include "ppapi/cpp/dev/text_input_dev.h" |
(...skipping 1327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1360 pp::Point OutOfProcessInstance::BoundScrollOffsetToDocument( | 1359 pp::Point OutOfProcessInstance::BoundScrollOffsetToDocument( |
1361 const pp::Point& scroll_offset) { | 1360 const pp::Point& scroll_offset) { |
1362 int max_x = document_size_.width() * zoom_ - plugin_dip_size_.width(); | 1361 int max_x = document_size_.width() * zoom_ - plugin_dip_size_.width(); |
1363 int x = std::max(std::min(scroll_offset.x(), max_x), 0); | 1362 int x = std::max(std::min(scroll_offset.x(), max_x), 0); |
1364 int max_y = document_size_.height() * zoom_ - plugin_dip_size_.height(); | 1363 int max_y = document_size_.height() * zoom_ - plugin_dip_size_.height(); |
1365 int y = std::max(std::min(scroll_offset.y(), max_y), 0); | 1364 int y = std::max(std::min(scroll_offset.y(), max_y), 0); |
1366 return pp::Point(x, y); | 1365 return pp::Point(x, y); |
1367 } | 1366 } |
1368 | 1367 |
1369 } // namespace chrome_pdf | 1368 } // namespace chrome_pdf |
OLD | NEW |