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 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
190 virtual void UnusedResourcesAreAvailable() OVERRIDE; | 190 virtual void UnusedResourcesAreAvailable() OVERRIDE; |
191 | 191 |
192 // ui::GestureProviderClient implementation. | 192 // ui::GestureProviderClient implementation. |
193 virtual void OnGestureEvent(const ui::GestureEventData& gesture) OVERRIDE; | 193 virtual void OnGestureEvent(const ui::GestureEventData& gesture) OVERRIDE; |
194 | 194 |
195 // ui::WindowAndroidObserver implementation. | 195 // ui::WindowAndroidObserver implementation. |
196 virtual void OnCompositingDidCommit() OVERRIDE; | 196 virtual void OnCompositingDidCommit() OVERRIDE; |
197 virtual void OnAttachCompositor() OVERRIDE {} | 197 virtual void OnAttachCompositor() OVERRIDE {} |
198 virtual void OnDetachCompositor() OVERRIDE; | 198 virtual void OnDetachCompositor() OVERRIDE; |
199 virtual void OnWillDestroyWindow() OVERRIDE; | 199 virtual void OnWillDestroyWindow() OVERRIDE; |
| 200 virtual void OnVSync(base::TimeTicks frame_time, |
| 201 base::TimeDelta vsync_period) OVERRIDE; |
200 | 202 |
201 // ImageTransportFactoryAndroidObserver implementation. | 203 // ImageTransportFactoryAndroidObserver implementation. |
202 virtual void OnLostResources() OVERRIDE; | 204 virtual void OnLostResources() OVERRIDE; |
203 | 205 |
204 // DelegatedFrameEvictor implementation | 206 // DelegatedFrameEvictor implementation |
205 virtual void EvictDelegatedFrame() OVERRIDE; | 207 virtual void EvictDelegatedFrame() OVERRIDE; |
206 | 208 |
207 virtual SkBitmap::Config PreferredReadbackFormat() OVERRIDE; | 209 virtual SkBitmap::Config PreferredReadbackFormat() OVERRIDE; |
208 | 210 |
209 // Non-virtual methods | 211 // Non-virtual methods |
210 void SetContentViewCore(ContentViewCoreImpl* content_view_core); | 212 void SetContentViewCore(ContentViewCoreImpl* content_view_core); |
211 SkColor GetCachedBackgroundColor() const; | 213 SkColor GetCachedBackgroundColor() const; |
212 void SendKeyEvent(const NativeWebKeyboardEvent& event); | 214 void SendKeyEvent(const NativeWebKeyboardEvent& event); |
213 void SendTouchEvent(const blink::WebTouchEvent& event); | 215 void SendTouchEvent(const blink::WebTouchEvent& event); |
214 void SendMouseEvent(const blink::WebMouseEvent& event); | 216 void SendMouseEvent(const blink::WebMouseEvent& event); |
215 void SendMouseWheelEvent(const blink::WebMouseWheelEvent& event); | 217 void SendMouseWheelEvent(const blink::WebMouseWheelEvent& event); |
216 void SendGestureEvent(const blink::WebGestureEvent& event); | 218 void SendGestureEvent(const blink::WebGestureEvent& event); |
217 void SendBeginFrame(const cc::BeginFrameArgs& args); | |
218 | 219 |
219 void OnTextInputStateChanged(const ViewHostMsg_TextInputState_Params& params); | 220 void OnTextInputStateChanged(const ViewHostMsg_TextInputState_Params& params); |
220 void OnDidChangeBodyBackgroundColor(SkColor color); | 221 void OnDidChangeBodyBackgroundColor(SkColor color); |
221 void OnDidOverscroll(const DidOverscrollParams& params); | 222 void OnDidOverscroll(const DidOverscrollParams& params); |
222 void OnStartContentIntent(const GURL& content_url); | 223 void OnStartContentIntent(const GURL& content_url); |
223 void OnSetNeedsBeginFrame(bool enabled); | 224 void OnSetNeedsBeginFrame(bool enabled); |
224 void OnSmartClipDataExtracted(const base::string16& result); | 225 void OnSmartClipDataExtracted(const base::string16& result); |
225 | 226 |
226 bool OnTouchEvent(const ui::MotionEvent& event); | 227 bool OnTouchEvent(const ui::MotionEvent& event); |
227 void ResetGestureDetection(); | 228 void ResetGestureDetection(); |
228 void SetDoubleTapSupportEnabled(bool enabled); | 229 void SetDoubleTapSupportEnabled(bool enabled); |
229 void SetMultiTouchZoomSupportEnabled(bool enabled); | 230 void SetMultiTouchZoomSupportEnabled(bool enabled); |
230 | 231 |
231 long GetNativeImeAdapter(); | 232 long GetNativeImeAdapter(); |
232 | 233 |
233 void WasResized(); | 234 void WasResized(); |
234 | 235 |
235 void GetScaledContentBitmap( | 236 void GetScaledContentBitmap( |
236 float scale, | 237 float scale, |
237 SkBitmap::Config bitmap_config, | 238 SkBitmap::Config bitmap_config, |
238 gfx::Rect src_subrect, | 239 gfx::Rect src_subrect, |
239 const base::Callback<void(bool, const SkBitmap&)>& result_callback); | 240 const base::Callback<void(bool, const SkBitmap&)>& result_callback); |
240 | 241 |
241 bool HasValidFrame() const; | 242 bool HasValidFrame() const; |
242 | 243 |
243 void MoveCaret(const gfx::Point& point); | 244 void MoveCaret(const gfx::Point& point); |
244 | 245 |
245 // Returns true when animation ticks are still needed. This avoids a separate | |
246 // round-trip for requesting follow-up animation. | |
247 bool Animate(base::TimeTicks frame_time); | |
248 | |
249 void SynchronousFrameMetadata( | 246 void SynchronousFrameMetadata( |
250 const cc::CompositorFrameMetadata& frame_metadata); | 247 const cc::CompositorFrameMetadata& frame_metadata); |
251 | 248 |
252 void SetOverlayVideoMode(bool enabled); | 249 void SetOverlayVideoMode(bool enabled); |
253 | 250 |
254 private: | 251 private: |
255 void RunAckCallbacks(); | 252 void RunAckCallbacks(); |
256 | 253 |
257 void DestroyDelegatedContent(); | 254 void DestroyDelegatedContent(); |
258 void SwapDelegatedFrame(uint32 output_surface_id, | 255 void SwapDelegatedFrame(uint32 output_surface_id, |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
300 void ReleaseLocksOnSurface(); | 297 void ReleaseLocksOnSurface(); |
301 | 298 |
302 // Drop any incoming frames from the renderer when there are locks on the | 299 // Drop any incoming frames from the renderer when there are locks on the |
303 // current frame. | 300 // current frame. |
304 void RetainFrame(uint32 output_surface_id, | 301 void RetainFrame(uint32 output_surface_id, |
305 scoped_ptr<cc::CompositorFrame> frame); | 302 scoped_ptr<cc::CompositorFrame> frame); |
306 | 303 |
307 void InternalSwapCompositorFrame(uint32 output_surface_id, | 304 void InternalSwapCompositorFrame(uint32 output_surface_id, |
308 scoped_ptr<cc::CompositorFrame> frame); | 305 scoped_ptr<cc::CompositorFrame> frame); |
309 | 306 |
| 307 void SetNeedsAnimate(); |
| 308 bool Animate(base::TimeTicks frame_time); |
| 309 |
| 310 |
310 // The model object. | 311 // The model object. |
311 RenderWidgetHostImpl* host_; | 312 RenderWidgetHostImpl* host_; |
312 | 313 |
313 // Used to track whether this render widget needs a BeginFrame. | 314 // Used to track whether this render widget needs a BeginFrame. |
314 bool needs_begin_frame_; | 315 bool needs_begin_frame_; |
315 | 316 |
316 bool is_showing_; | 317 bool is_showing_; |
317 | 318 |
318 // ContentViewCoreImpl is our interface to the view system. | 319 // ContentViewCoreImpl is our interface to the view system. |
319 ContentViewCoreImpl* content_view_core_; | 320 ContentViewCoreImpl* content_view_core_; |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
372 }; | 373 }; |
373 | 374 |
374 scoped_ptr<LastFrameInfo> last_frame_info_; | 375 scoped_ptr<LastFrameInfo> last_frame_info_; |
375 | 376 |
376 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewAndroid); | 377 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewAndroid); |
377 }; | 378 }; |
378 | 379 |
379 } // namespace content | 380 } // namespace content |
380 | 381 |
381 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_ANDROID_H_ | 382 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_ANDROID_H_ |
OLD | NEW |