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

Side by Side Diff: ppapi/api/ppb_view.idl

Issue 329033003: Add GetScrollOffset function to PPB_View (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « content/renderer/pepper/pepper_plugin_instance_impl.cc ('k') | ppapi/c/ppb_view.h » ('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 5
6 /** 6 /**
7 * This file defines the <code>PPB_View</code> struct representing the state 7 * This file defines the <code>PPB_View</code> struct representing the state
8 * of the view of an instance. 8 * of the view of an instance.
9 */ 9 */
10 10
11 [generate_thunk] 11 [generate_thunk]
12 12
13 label Chrome { 13 label Chrome {
14 M18 = 1.0, 14 M18 = 1.0,
15 M28 = 1.1 15 M28 = 1.1,
16 M37 = 1.2
dmichael (off chromium) 2014/06/11 20:24:14 It might be best to use channel=dev to start out,
raymes 2014/06/12 01:06:15 Done.
16 }; 17 };
17 18
18 /** 19 /**
19 * <code>PPB_View</code> represents the state of the view of an instance. 20 * <code>PPB_View</code> represents the state of the view of an instance.
20 * You will receive new view information using 21 * You will receive new view information using
21 * <code>PPP_Instance.DidChangeView</code>. 22 * <code>PPP_Instance.DidChangeView</code>.
22 */ 23 */
23 [macro="PPB_VIEW_INTERFACE"] 24 [macro="PPB_VIEW_INTERFACE"]
24 interface PPB_View { 25 interface PPB_View {
25 /** 26 /**
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 * would not be visible to the user, but IsVisible() will return true. 82 * would not be visible to the user, but IsVisible() will return true.
82 * 83 *
83 * Use the result to speed up or stop updates for invisible module 84 * Use the result to speed up or stop updates for invisible module
84 * instances. 85 * instances.
85 * 86 *
86 * This function performs the duties of GetRect() (determining whether the 87 * This function performs the duties of GetRect() (determining whether the
87 * module instance is scrolled into view and the clip rectangle is nonempty) 88 * module instance is scrolled into view and the clip rectangle is nonempty)
88 * and IsPageVisible() (whether the page is visible to the user). 89 * and IsPageVisible() (whether the page is visible to the user).
89 * 90 *
90 * @param resource A <code>PP_Resource</code> corresponding to a 91 * @param resource A <code>PP_Resource</code> corresponding to a
91 * <code>PPB_View</code> resource. 92 * <code>PPB_View</code> resource.
92 * 93 *
93 * @return <code>PP_TRUE</code> if the instance might be visible to the 94 * @return <code>PP_TRUE</code> if the instance might be visible to the
94 * user, <code>PP_FALSE</code> if it is definitely not visible. 95 * user, <code>PP_FALSE</code> if it is definitely not visible.
95 */ 96 */
96 PP_Bool IsVisible([in] PP_Resource resource); 97 PP_Bool IsVisible([in] PP_Resource resource);
97 98
98 /** 99 /**
99 * IsPageVisible() determines if the page that contains the module instance 100 * IsPageVisible() determines if the page that contains the module instance
100 * is visible. The most common cause of invisible pages is that 101 * is visible. The most common cause of invisible pages is that
101 * the page is in a background tab in the browser. 102 * the page is in a background tab in the browser.
102 * 103 *
103 * Most applications should use IsVisible() instead of this function since 104 * Most applications should use IsVisible() instead of this function since
104 * the module instance could be scrolled off of a visible page, and this 105 * the module instance could be scrolled off of a visible page, and this
105 * function will still return true. However, depending on how your module 106 * function will still return true. However, depending on how your module
106 * interacts with the page, there may be certain updates that you may want to 107 * interacts with the page, there may be certain updates that you may want to
107 * perform when the page is visible even if your specific module instance is 108 * perform when the page is visible even if your specific module instance is
108 * not visible. 109 * not visible.
109 * 110 *
110 * @param resource A <code>PP_Resource</code> corresponding to a 111 * @param resource A <code>PP_Resource</code> corresponding to a
111 * <code>PPB_View</code> resource. 112 * <code>PPB_View</code> resource.
112 * 113 *
113 * @return <code>PP_TRUE</code> if the instance is plausibly visible to the 114 * @return <code>PP_TRUE</code> if the instance is plausibly visible to the
114 * user, <code>PP_FALSE</code> if it is definitely not visible. 115 * user, <code>PP_FALSE</code> if it is definitely not visible.
115 */ 116 */
116 PP_Bool IsPageVisible([in] PP_Resource resource); 117 PP_Bool IsPageVisible([in] PP_Resource resource);
117 118
118 /** 119 /**
119 * GetClipRect() returns the clip rectangle relative to the upper-left corner 120 * GetClipRect() returns the clip rectangle relative to the upper-left corner
120 * of the module instance. This rectangle indicates the portions of the module 121 * of the module instance. This rectangle indicates the portions of the module
121 * instance that are scrolled into view. 122 * instance that are scrolled into view.
(...skipping 22 matching lines...) Expand all
144 * it is likely that the previous backing store of the module instance will 145 * it is likely that the previous backing store of the module instance will
145 * be used for the first paint, and will be updated later when your 146 * be used for the first paint, and will be updated later when your
146 * application generates new content with the new clip. This may cause 147 * application generates new content with the new clip. This may cause
147 * flickering at the boundaries when scrolling. If you do choose to do 148 * flickering at the boundaries when scrolling. If you do choose to do
148 * partial updates, you may want to think about what color the invisible 149 * partial updates, you may want to think about what color the invisible
149 * portions of your backing store contain (be it transparent or some 150 * portions of your backing store contain (be it transparent or some
150 * background color) or to paint a certain region outside the clip to reduce 151 * background color) or to paint a certain region outside the clip to reduce
151 * the visual distraction when this happens. 152 * the visual distraction when this happens.
152 * 153 *
153 * @param resource A <code>PP_Resource</code> corresponding to a 154 * @param resource A <code>PP_Resource</code> corresponding to a
154 * <code>PPB_View</code> resource. 155 * <code>PPB_View</code> resource.
155 * 156 *
156 * @param clip Output argument receiving the clip rect on success. 157 * @param clip Output argument receiving the clip rect on success.
157 * 158 *
158 * @return Returns <code>PP_TRUE</code> if the resource was valid and the 159 * @return Returns <code>PP_TRUE</code> if the resource was valid and the
159 * clip rect was filled in, <code>PP_FALSE</code> if not. 160 * clip rect was filled in, <code>PP_FALSE</code> if not.
160 */ 161 */
161 PP_Bool GetClipRect([in] PP_Resource resource, 162 PP_Bool GetClipRect([in] PP_Resource resource,
162 [out] PP_Rect clip); 163 [out] PP_Rect clip);
163 164
164 /** 165 /**
(...skipping 21 matching lines...) Expand all
186 * pixel coordinates used for Web content. 187 * pixel coordinates used for Web content.
187 * 188 *
188 * @param[in] resource A <code>PP_Resource</code> corresponding to a 189 * @param[in] resource A <code>PP_Resource</code> corresponding to a
189 * <code>PPB_View</code> resource. 190 * <code>PPB_View</code> resource.
190 * 191 *
191 * @return css_scale A <code>float</code> value representing the number of 192 * @return css_scale A <code>float</code> value representing the number of
192 * DIPs per CSS pixel. If the resource is invalid, the value will be 0.0. 193 * DIPs per CSS pixel. If the resource is invalid, the value will be 0.0.
193 */ 194 */
194 [version=1.1] 195 [version=1.1]
195 float_t GetCSSScale([in] PP_Resource resource); 196 float_t GetCSSScale([in] PP_Resource resource);
197
198 /**
199 * GetScrollOffset returns the scroll offset of the window containing the
200 * plugin. This value will only be valid if the module instance is visible
dmichael (off chromium) 2014/06/11 20:24:14 Can you get the same information from the position
raymes 2014/06/12 01:06:15 I think this works except for the cases where the
dmichael (off chromium) 2014/06/16 22:31:55 Oh, you're using position:fixed? I had thought you
raymes 2014/06/17 00:43:00 Yeah...unfortunately I put that strategy to the si
201 * (that is, IsVisible() is true) otherwise (0, 0) will be returned.
202 *
203 * @param[in] resource A <code>PP_Resource</code> corresponding to a
204 * <code>PPB_View</code> resource.
205 *
206 * @param[out] offset A <code>PP_Point</code> which will be set to the value
207 * of the scroll offset.
dmichael (off chromium) 2014/06/11 20:24:14 in CSS pixels?
raymes 2014/06/12 01:06:15 Done.
208 *
209 * @return Returns <code>PP_TRUE</code> if the resource was valid and the
210 * offset was filled in, <code>PP_FALSE</code> if not.
211 */
212 [version=1.2]
213 PP_Bool GetScrollOffset([in] PP_Resource resource,
214 [out] PP_Point offset);
196 }; 215 };
197 216
OLDNEW
« no previous file with comments | « content/renderer/pepper/pepper_plugin_instance_impl.cc ('k') | ppapi/c/ppb_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698