diff options
author | raymes@chromium.org <raymes@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-06-19 01:48:14 +0000 |
---|---|---|
committer | raymes@chromium.org <raymes@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-06-19 01:48:14 +0000 |
commit | 5015a072d245d2ce4526a136112c80c2f80d6b4a (patch) | |
tree | 5fb85f86c5e0a91f967b5fdd0d20ff669884572f /ppapi/api | |
parent | ff7570302fdfb87f54d363e14d4310fe101e990e (diff) | |
download | chromium_src-5015a072d245d2ce4526a136112c80c2f80d6b4a.zip chromium_src-5015a072d245d2ce4526a136112c80c2f80d6b4a.tar.gz chromium_src-5015a072d245d2ce4526a136112c80c2f80d6b4a.tar.bz2 |
Add GetScrollOffset function to PPB_View
This adds a function to PPB_View which allows plugins to know the scroll offset
of the page when they are in view. This is useful for OOP PDF which uses the
scroll offset of the window it is contained in to determine the document's
scroll location. A web page can send scroll location via postMessage but
this is slow. Sending the offset directly via view messages is much faster
and seems reasonable.
We don't send the scroll offset in the cases where the plugin is off screen
to avoid any more additional IPC traffic than what currently exists.
BUG=303491
Review URL: https://codereview.chromium.org/329033003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@278236 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi/api')
-rw-r--r-- | ppapi/api/ppb_view.idl | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/ppapi/api/ppb_view.idl b/ppapi/api/ppb_view.idl index a01c5e8..e0e0cce 100644 --- a/ppapi/api/ppb_view.idl +++ b/ppapi/api/ppb_view.idl @@ -12,7 +12,8 @@ label Chrome { M18 = 1.0, - M28 = 1.1 + M28 = 1.1, + [channel=dev] M37 = 1.2 }; /** @@ -88,7 +89,7 @@ interface PPB_View { * and IsPageVisible() (whether the page is visible to the user). * * @param resource A <code>PP_Resource</code> corresponding to a - * <code>PPB_View</code> resource. + * <code>PPB_View</code> resource. * * @return <code>PP_TRUE</code> if the instance might be visible to the * user, <code>PP_FALSE</code> if it is definitely not visible. @@ -108,7 +109,7 @@ interface PPB_View { * not visible. * * @param resource A <code>PP_Resource</code> corresponding to a - * <code>PPB_View</code> resource. + * <code>PPB_View</code> resource. * * @return <code>PP_TRUE</code> if the instance is plausibly visible to the * user, <code>PP_FALSE</code> if it is definitely not visible. @@ -151,7 +152,7 @@ interface PPB_View { * the visual distraction when this happens. * * @param resource A <code>PP_Resource</code> corresponding to a - * <code>PPB_View</code> resource. + * <code>PPB_View</code> resource. * * @param clip Output argument receiving the clip rect on success. * @@ -193,5 +194,22 @@ interface PPB_View { */ [version=1.1] float_t GetCSSScale([in] PP_Resource resource); + + /** + * GetScrollOffset returns the scroll offset of the window containing the + * plugin. + * + * @param[in] resource A <code>PP_Resource</code> corresponding to a + * <code>PPB_View</code> resource. + * + * @param[out] offset A <code>PP_Point</code> which will be set to the value + * of the scroll offset in CSS pixels. + * + * @return Returns <code>PP_TRUE</code> if the resource was valid and the + * offset was filled in, <code>PP_FALSE</code> if not. + */ + [version=1.2] + PP_Bool GetScrollOffset([in] PP_Resource resource, + [out] PP_Point offset); }; |