OLD | NEW |
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 #ifndef CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_ANDROID_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_ANDROID_H_ |
6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_ANDROID_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_ANDROID_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <queue> | 9 #include <queue> |
10 | 10 |
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
186 virtual void FatalAccessibilityTreeError() OVERRIDE; | 186 virtual void FatalAccessibilityTreeError() OVERRIDE; |
187 | 187 |
188 // cc::DelegatedFrameResourceCollectionClient implementation. | 188 // cc::DelegatedFrameResourceCollectionClient implementation. |
189 virtual void UnusedResourcesAreAvailable() OVERRIDE; | 189 virtual void UnusedResourcesAreAvailable() OVERRIDE; |
190 | 190 |
191 // ui::WindowAndroidObserver implementation. | 191 // ui::WindowAndroidObserver implementation. |
192 virtual void OnCompositingDidCommit() OVERRIDE; | 192 virtual void OnCompositingDidCommit() OVERRIDE; |
193 virtual void OnAttachCompositor() OVERRIDE {} | 193 virtual void OnAttachCompositor() OVERRIDE {} |
194 virtual void OnDetachCompositor() OVERRIDE; | 194 virtual void OnDetachCompositor() OVERRIDE; |
195 virtual void OnWillDestroyWindow() OVERRIDE; | 195 virtual void OnWillDestroyWindow() OVERRIDE; |
| 196 virtual void OnVSync(base::TimeTicks frame_time, |
| 197 base::TimeDelta vsync_period) OVERRIDE; |
196 | 198 |
197 // ImageTransportFactoryAndroidObserver implementation. | 199 // ImageTransportFactoryAndroidObserver implementation. |
198 virtual void OnLostResources() OVERRIDE; | 200 virtual void OnLostResources() OVERRIDE; |
199 | 201 |
200 // DelegatedFrameEvictor implementation | 202 // DelegatedFrameEvictor implementation |
201 virtual void EvictDelegatedFrame() OVERRIDE; | 203 virtual void EvictDelegatedFrame() OVERRIDE; |
202 | 204 |
203 virtual SkBitmap::Config PreferredReadbackFormat() OVERRIDE; | 205 virtual SkBitmap::Config PreferredReadbackFormat() OVERRIDE; |
204 | 206 |
205 // Non-virtual methods | 207 // Non-virtual methods |
206 void SetContentViewCore(ContentViewCoreImpl* content_view_core); | 208 void SetContentViewCore(ContentViewCoreImpl* content_view_core); |
207 SkColor GetCachedBackgroundColor() const; | 209 SkColor GetCachedBackgroundColor() const; |
208 void SendKeyEvent(const NativeWebKeyboardEvent& event); | 210 void SendKeyEvent(const NativeWebKeyboardEvent& event); |
209 void SendTouchEvent(const blink::WebTouchEvent& event); | 211 void SendTouchEvent(const blink::WebTouchEvent& event); |
210 void SendMouseEvent(const blink::WebMouseEvent& event); | 212 void SendMouseEvent(const blink::WebMouseEvent& event); |
211 void SendMouseWheelEvent(const blink::WebMouseWheelEvent& event); | 213 void SendMouseWheelEvent(const blink::WebMouseWheelEvent& event); |
212 void SendGestureEvent(const blink::WebGestureEvent& event); | 214 void SendGestureEvent(const blink::WebGestureEvent& event); |
213 void SendBeginFrame(const cc::BeginFrameArgs& args); | |
214 | 215 |
215 void OnTextInputStateChanged(const ViewHostMsg_TextInputState_Params& params); | 216 void OnTextInputStateChanged(const ViewHostMsg_TextInputState_Params& params); |
216 void OnDidChangeBodyBackgroundColor(SkColor color); | 217 void OnDidChangeBodyBackgroundColor(SkColor color); |
217 void OnStartContentIntent(const GURL& content_url); | 218 void OnStartContentIntent(const GURL& content_url); |
218 void OnSetNeedsBeginFrame(bool enabled); | 219 void OnSetNeedsBeginFrame(bool enabled); |
219 void OnSmartClipDataExtracted(const base::string16& result); | 220 void OnSmartClipDataExtracted(const base::string16& result); |
220 | 221 |
221 long GetNativeImeAdapter(); | 222 long GetNativeImeAdapter(); |
222 | 223 |
223 void WasResized(); | 224 void WasResized(); |
224 | 225 |
225 void GetScaledContentBitmap( | 226 void GetScaledContentBitmap( |
226 float scale, | 227 float scale, |
227 SkBitmap::Config bitmap_config, | 228 SkBitmap::Config bitmap_config, |
228 gfx::Rect src_subrect, | 229 gfx::Rect src_subrect, |
229 const base::Callback<void(bool, const SkBitmap&)>& result_callback); | 230 const base::Callback<void(bool, const SkBitmap&)>& result_callback); |
230 | 231 |
231 bool HasValidFrame() const; | 232 bool HasValidFrame() const; |
232 | 233 |
233 void MoveCaret(const gfx::Point& point); | 234 void MoveCaret(const gfx::Point& point); |
234 | 235 |
235 // Returns true when animation ticks are still needed. This avoids a separate | |
236 // round-trip for requesting follow-up animation. | |
237 bool Animate(base::TimeTicks frame_time); | |
238 | |
239 void SynchronousFrameMetadata( | 236 void SynchronousFrameMetadata( |
240 const cc::CompositorFrameMetadata& frame_metadata); | 237 const cc::CompositorFrameMetadata& frame_metadata); |
241 | 238 |
242 void SetOverlayVideoMode(bool enabled); | 239 void SetOverlayVideoMode(bool enabled); |
243 | 240 |
244 private: | 241 private: |
245 void RunAckCallbacks(); | 242 void RunAckCallbacks(); |
246 | 243 |
247 void DestroyDelegatedContent(); | 244 void DestroyDelegatedContent(); |
248 void SwapDelegatedFrame(uint32 output_surface_id, | 245 void SwapDelegatedFrame(uint32 output_surface_id, |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
290 void ReleaseLocksOnSurface(); | 287 void ReleaseLocksOnSurface(); |
291 | 288 |
292 // Drop any incoming frames from the renderer when there are locks on the | 289 // Drop any incoming frames from the renderer when there are locks on the |
293 // current frame. | 290 // current frame. |
294 void RetainFrame(uint32 output_surface_id, | 291 void RetainFrame(uint32 output_surface_id, |
295 scoped_ptr<cc::CompositorFrame> frame); | 292 scoped_ptr<cc::CompositorFrame> frame); |
296 | 293 |
297 void InternalSwapCompositorFrame(uint32 output_surface_id, | 294 void InternalSwapCompositorFrame(uint32 output_surface_id, |
298 scoped_ptr<cc::CompositorFrame> frame); | 295 scoped_ptr<cc::CompositorFrame> frame); |
299 | 296 |
| 297 void SetNeedsAnimate(); |
| 298 bool Animate(base::TimeTicks frame_time); |
| 299 |
| 300 |
300 // The model object. | 301 // The model object. |
301 RenderWidgetHostImpl* host_; | 302 RenderWidgetHostImpl* host_; |
302 | 303 |
303 // Used to track whether this render widget needs a BeginFrame. | 304 // Used to track whether this render widget needs a BeginFrame. |
304 bool needs_begin_frame_; | 305 bool needs_begin_frame_; |
| 306 bool requested_vsync_for_touch_event_; |
305 | 307 |
306 bool is_showing_; | 308 bool is_showing_; |
307 | 309 |
308 // ContentViewCoreImpl is our interface to the view system. | 310 // ContentViewCoreImpl is our interface to the view system. |
309 ContentViewCoreImpl* content_view_core_; | 311 ContentViewCoreImpl* content_view_core_; |
310 | 312 |
311 ImeAdapterAndroid ime_adapter_android_; | 313 ImeAdapterAndroid ime_adapter_android_; |
312 | 314 |
313 // Body background color of the underlying document. | 315 // Body background color of the underlying document. |
314 SkColor cached_background_color_; | 316 SkColor cached_background_color_; |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
358 }; | 360 }; |
359 | 361 |
360 scoped_ptr<LastFrameInfo> last_frame_info_; | 362 scoped_ptr<LastFrameInfo> last_frame_info_; |
361 | 363 |
362 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewAndroid); | 364 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewAndroid); |
363 }; | 365 }; |
364 | 366 |
365 } // namespace content | 367 } // namespace content |
366 | 368 |
367 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_ANDROID_H_ | 369 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_ANDROID_H_ |
OLD | NEW |