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 <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <algorithm> // for min/max() | 10 #include <algorithm> // for min/max() |
(...skipping 962 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
973 message.Set(kType, kJSGoToPageType); | 973 message.Set(kType, kJSGoToPageType); |
974 message.Set(kJSPageNumber, pp::Var(page)); | 974 message.Set(kJSPageNumber, pp::Var(page)); |
975 PostMessage(message); | 975 PostMessage(message); |
976 } | 976 } |
977 | 977 |
978 void OutOfProcessInstance::NavigateTo(const std::string& url, | 978 void OutOfProcessInstance::NavigateTo(const std::string& url, |
979 WindowOpenDisposition disposition) { | 979 WindowOpenDisposition disposition) { |
980 pp::VarDictionary message; | 980 pp::VarDictionary message; |
981 message.Set(kType, kJSNavigateType); | 981 message.Set(kType, kJSNavigateType); |
982 message.Set(kJSNavigateUrl, url); | 982 message.Set(kJSNavigateUrl, url); |
983 message.Set(kJSNavigateWindowOpenDisposition, pp::Var(disposition)); | 983 message.Set(kJSNavigateWindowOpenDisposition, |
| 984 pp::Var(static_cast<int32_t>(disposition))); |
984 PostMessage(message); | 985 PostMessage(message); |
985 } | 986 } |
986 | 987 |
987 void OutOfProcessInstance::UpdateCursor(PP_CursorType_Dev cursor) { | 988 void OutOfProcessInstance::UpdateCursor(PP_CursorType_Dev cursor) { |
988 if (cursor == cursor_) | 989 if (cursor == cursor_) |
989 return; | 990 return; |
990 cursor_ = cursor; | 991 cursor_ = cursor; |
991 | 992 |
992 const PPB_CursorControl_Dev* cursor_interface = | 993 const PPB_CursorControl_Dev* cursor_interface = |
993 reinterpret_cast<const PPB_CursorControl_Dev*>( | 994 reinterpret_cast<const PPB_CursorControl_Dev*>( |
(...skipping 528 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1522 const pp::FloatPoint& scroll_offset) { | 1523 const pp::FloatPoint& scroll_offset) { |
1523 float max_x = document_size_.width() * zoom_ - plugin_dip_size_.width(); | 1524 float max_x = document_size_.width() * zoom_ - plugin_dip_size_.width(); |
1524 float x = std::max(std::min(scroll_offset.x(), max_x), 0.0f); | 1525 float x = std::max(std::min(scroll_offset.x(), max_x), 0.0f); |
1525 float min_y = -top_toolbar_height_; | 1526 float min_y = -top_toolbar_height_; |
1526 float max_y = document_size_.height() * zoom_ - plugin_dip_size_.height(); | 1527 float max_y = document_size_.height() * zoom_ - plugin_dip_size_.height(); |
1527 float y = std::max(std::min(scroll_offset.y(), max_y), min_y); | 1528 float y = std::max(std::min(scroll_offset.y(), max_y), min_y); |
1528 return pp::FloatPoint(x, y); | 1529 return pp::FloatPoint(x, y); |
1529 } | 1530 } |
1530 | 1531 |
1531 } // namespace chrome_pdf | 1532 } // namespace chrome_pdf |
OLD | NEW |