summaryrefslogtreecommitdiffstats
path: root/content/port/browser
diff options
context:
space:
mode:
authordanakj@chromium.org <danakj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-10-31 18:33:24 +0000
committerdanakj@chromium.org <danakj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-10-31 18:33:24 +0000
commitceb36f7d5cec71407b265aba887cd64216d24731 (patch)
treeea977c72eb7882c1629a5c78f56b1a9e7e3e6b60 /content/port/browser
parent80211f670f34191d80b875086aaf7b5b06a743d4 (diff)
downloadchromium_src-ceb36f7d5cec71407b265aba887cd64216d24731.zip
chromium_src-ceb36f7d5cec71407b265aba887cd64216d24731.tar.gz
chromium_src-ceb36f7d5cec71407b265aba887cd64216d24731.tar.bz2
Add Vector2d classes that represent offsets, instead of using Point.
Previously Point served two purposes, to be a position in 2d space, and also an offset from the origin. This introduces a Vector2d class to represent an offset, allowing typesafety checks for geometric operations. The following are now the case: Point +/- Vector = Point - A point plus/minus an offset gives you a point at a position offset by the vector. Vector +/- Vector = Vector - Two offsets can be added together to make a new offset. Point - Point = Vector - Subtracting one point from another gives you the offset between the two points. We add some new methods to perform these operations: Rect::OffsetFromOrigin() gives the offset between the position of the rect and the origin. Point::OffsetFromOrigin() gives the offset between the point and the origin. PointAtOffsetFromOrigin(Vector2d) converts a Vector2d to a Point at the given offset away from the origin. Rect::Offset(), Point::Add(), and Point::Subtract() now receive a Vector2d instead of a point. BUG=147395 R=sky Review URL: https://codereview.chromium.org/11269022 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@165198 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/port/browser')
-rw-r--r--content/port/browser/render_view_host_delegate_view.h4
-rw-r--r--content/port/browser/render_widget_host_view_port.h4
2 files changed, 4 insertions, 4 deletions
diff --git a/content/port/browser/render_view_host_delegate_view.h b/content/port/browser/render_view_host_delegate_view.h
index b59d6e0..4b84cb84 100644
--- a/content/port/browser/render_view_host_delegate_view.h
+++ b/content/port/browser/render_view_host_delegate_view.h
@@ -18,8 +18,8 @@ struct WebMenuItem;
namespace gfx {
class ImageSkia;
-class Point;
class Rect;
+class Vector2d;
}
namespace content {
@@ -53,7 +53,7 @@ class CONTENT_EXPORT RenderViewHostDelegateView {
virtual void StartDragging(const WebDropData& drop_data,
WebKit::WebDragOperationsMask allowed_ops,
const gfx::ImageSkia& image,
- const gfx::Point& image_offset) {}
+ const gfx::Vector2d& image_offset) {}
// The page wants to update the mouse cursor during a drag & drop operation.
// |operation| describes the current operation (none, move, copy, link.)
diff --git a/content/port/browser/render_widget_host_view_port.h b/content/port/browser/render_widget_host_view_port.h
index ef4f507..ffa1b6d 100644
--- a/content/port/browser/render_widget_host_view_port.h
+++ b/content/port/browser/render_widget_host_view_port.h
@@ -79,7 +79,7 @@ class CONTENT_EXPORT RenderWidgetHostViewPort : public RenderWidgetHostView {
// Moves all plugin windows as described in the given list.
// |scroll_offset| is the scroll offset of the render view.
virtual void MovePluginWindows(
- const gfx::Point& scroll_offset,
+ const gfx::Vector2d& scroll_offset,
const std::vector<webkit::npapi::WebPluginGeometry>& moves) = 0;
// Take focus from the associated View component.
@@ -229,7 +229,7 @@ class CONTENT_EXPORT RenderWidgetHostViewPort : public RenderWidgetHostView {
#if defined(OS_ANDROID)
virtual void SetCachedPageScaleFactorLimits(float minimum_scale,
float maximum_scale) = 0;
- virtual void UpdateFrameInfo(const gfx::Point& scroll_offset,
+ virtual void UpdateFrameInfo(const gfx::Vector2d& scroll_offset,
float page_scale_factor,
const gfx::Size& content_size) = 0;
virtual void HasTouchEventHandlers(bool need_touch_events) = 0;