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 1688 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1699 } | 1699 } |
1700 | 1700 |
1701 if (page_index != -1) { | 1701 if (page_index != -1) { |
1702 double page_x, page_y; | 1702 double page_x, page_y; |
1703 pp::Point point = event.GetPosition(); | 1703 pp::Point point = event.GetPosition(); |
1704 DeviceToPage(page_index, point.x(), point.y(), &page_x, &page_y); | 1704 DeviceToPage(page_index, point.x(), point.y(), &page_x, &page_y); |
1705 FORM_OnMouseMove(form_, pages_[page_index]->GetPage(), 0, page_x, page_y); | 1705 FORM_OnMouseMove(form_, pages_[page_index]->GetPage(), 0, page_x, page_y); |
1706 } | 1706 } |
1707 | 1707 |
1708 client_->UpdateCursor(cursor); | 1708 client_->UpdateCursor(cursor); |
1709 pp::Point point = event.GetPosition(); | |
1710 std::string url = GetLinkAtPosition(event.GetPosition()); | 1709 std::string url = GetLinkAtPosition(event.GetPosition()); |
1711 if (url != link_under_cursor_) { | 1710 if (url != link_under_cursor_) { |
1712 link_under_cursor_ = url; | 1711 link_under_cursor_ = url; |
1713 pp::PDF::SetLinkUnderCursor(GetPluginInstance(), url.c_str()); | 1712 pp::PDF::SetLinkUnderCursor(GetPluginInstance(), url.c_str()); |
1714 } | 1713 } |
1715 // No need to swallow the event, since this might interfere with the | 1714 // No need to swallow the event, since this might interfere with the |
1716 // scrollbars if the user is dragging them. | 1715 // scrollbars if the user is dragging them. |
1717 return false; | 1716 return false; |
1718 } | 1717 } |
1719 | 1718 |
(...skipping 2174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3894 FPDF_DOCUMENT doc = | 3893 FPDF_DOCUMENT doc = |
3895 FPDF_LoadMemDocument(pdf_buffer, pdf_buffer_size, nullptr); | 3894 FPDF_LoadMemDocument(pdf_buffer, pdf_buffer_size, nullptr); |
3896 if (!doc) | 3895 if (!doc) |
3897 return false; | 3896 return false; |
3898 bool success = FPDF_GetPageSizeByIndex(doc, page_number, width, height) != 0; | 3897 bool success = FPDF_GetPageSizeByIndex(doc, page_number, width, height) != 0; |
3899 FPDF_CloseDocument(doc); | 3898 FPDF_CloseDocument(doc); |
3900 return success; | 3899 return success; |
3901 } | 3900 } |
3902 | 3901 |
3903 } // namespace chrome_pdf | 3902 } // namespace chrome_pdf |
OLD | NEW |