summaryrefslogtreecommitdiffstats
path: root/content/renderer
diff options
context:
space:
mode:
Diffstat (limited to 'content/renderer')
-rw-r--r--content/renderer/render_view_impl.cc17
-rw-r--r--content/renderer/render_view_impl.h2
-rw-r--r--content/renderer/render_widget.cc4
-rw-r--r--content/renderer/render_widget.h2
4 files changed, 12 insertions, 13 deletions
diff --git a/content/renderer/render_view_impl.cc b/content/renderer/render_view_impl.cc
index 26540ed..cbd27af 100644
--- a/content/renderer/render_view_impl.cc
+++ b/content/renderer/render_view_impl.cc
@@ -2162,12 +2162,10 @@ void RenderViewImpl::showContextMenu(
gfx::Rect start_rect;
gfx::Rect end_rect;
GetSelectionBounds(&start_rect, &end_rect);
- gfx::Point start_point(start_rect.x(),
- start_rect.bottom());
- gfx::Point end_point(end_rect.right(),
- end_rect.bottom());
- params.selection_start = GetScrollOffset().Add(start_point);
- params.selection_end = GetScrollOffset().Add(end_point);
+ params.selection_start =
+ gfx::Point(start_rect.x(), start_rect.bottom()) + GetScrollOffset();
+ params.selection_end =
+ gfx::Point(end_rect.right(), end_rect.bottom()) + GetScrollOffset();
#endif
Send(new ViewHostMsg_ContextMenu(routing_id_, params));
@@ -2237,9 +2235,10 @@ void RenderViewImpl::startDragging(WebFrame* frame,
const WebDragData& data,
WebDragOperationsMask mask,
const WebImage& image,
- const WebPoint& imageOffset) {
+ const WebPoint& webImageOffset) {
WebDropData drop_data(data);
drop_data.referrer_policy = frame->document().referrerPolicy();
+ gfx::Vector2d imageOffset(webImageOffset.x, webImageOffset.y);
Send(new DragHostMsg_StartDragging(routing_id_,
drop_data,
mask,
@@ -5518,9 +5517,9 @@ webkit::ppapi::PluginInstance* RenderViewImpl::GetBitmapForOptimizedPluginPaint(
paint_bounds, dib, location, clip, scale_factor);
}
-gfx::Point RenderViewImpl::GetScrollOffset() {
+gfx::Vector2d RenderViewImpl::GetScrollOffset() {
WebSize scroll_offset = webview()->mainFrame()->scrollOffset();
- return gfx::Point(scroll_offset.width, scroll_offset.height);
+ return gfx::Vector2d(scroll_offset.width, scroll_offset.height);
}
void RenderViewImpl::OnClearFocusedNode() {
diff --git a/content/renderer/render_view_impl.h b/content/renderer/render_view_impl.h
index 16f1bf8..4bf249c 100644
--- a/content/renderer/render_view_impl.h
+++ b/content/renderer/render_view_impl.h
@@ -738,7 +738,7 @@ class RenderViewImpl : public RenderWidget,
gfx::Rect* location,
gfx::Rect* clip,
float* scale_factor) OVERRIDE;
- virtual gfx::Point GetScrollOffset() OVERRIDE;
+ virtual gfx::Vector2d GetScrollOffset() OVERRIDE;
virtual void DidHandleKeyEvent() OVERRIDE;
virtual bool WillHandleMouseEvent(
const WebKit::WebMouseEvent& event) OVERRIDE;
diff --git a/content/renderer/render_widget.cc b/content/renderer/render_widget.cc
index 78e49a7..9e723b5 100644
--- a/content/renderer/render_widget.cc
+++ b/content/renderer/render_widget.cc
@@ -1626,9 +1626,9 @@ webkit::ppapi::PluginInstance* RenderWidget::GetBitmapForOptimizedPluginPaint(
return NULL;
}
-gfx::Point RenderWidget::GetScrollOffset() {
+gfx::Vector2d RenderWidget::GetScrollOffset() {
// Bare RenderWidgets don't support scroll offset.
- return gfx::Point(0, 0);
+ return gfx::Vector2d();
}
void RenderWidget::SetHidden(bool hidden) {
diff --git a/content/renderer/render_widget.h b/content/renderer/render_widget.h
index f818a89..eff42ccb 100644
--- a/content/renderer/render_widget.h
+++ b/content/renderer/render_widget.h
@@ -330,7 +330,7 @@ class CONTENT_EXPORT RenderWidget
// Gets the scroll offset of this widget, if this widget has a notion of
// scroll offset.
- virtual gfx::Point GetScrollOffset();
+ virtual gfx::Vector2d GetScrollOffset();
// Sets the "hidden" state of this widget. All accesses to is_hidden_ should
// use this method so that we can properly inform the RenderThread of our