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

Side by Side Diff: pdf/out_of_process_instance.cc

Issue 2248873002: Convert WindowOpenDisposition to an enum class. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 4 years, 3 months 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 | « ios/web/navigation/navigation_manager_impl.mm ('k') | pdf/pdfium/pdfium_engine.cc » ('j') | no next file with comments »
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/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
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
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
OLDNEW
« no previous file with comments | « ios/web/navigation/navigation_manager_impl.mm ('k') | pdf/pdfium/pdfium_engine.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698