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 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
240 | 240 |
241 void SetOverlayVideoMode(bool enabled); | 241 void SetOverlayVideoMode(bool enabled); |
242 | 242 |
243 typedef base::Callback< | 243 typedef base::Callback< |
244 void(const base::string16& content, int start_offset, int end_offset)> | 244 void(const base::string16& content, int start_offset, int end_offset)> |
245 TextSurroundingSelectionCallback; | 245 TextSurroundingSelectionCallback; |
246 void SetTextSurroundingSelectionCallback( | 246 void SetTextSurroundingSelectionCallback( |
247 const TextSurroundingSelectionCallback& callback); | 247 const TextSurroundingSelectionCallback& callback); |
248 | 248 |
249 private: | 249 private: |
| 250 enum VSyncSubscriberType { |
| 251 INPUT = 1 << 0, |
| 252 BEGIN_FRAME = 1 << 1 |
| 253 }; |
| 254 |
250 // TouchSelectionControllerClient implementation. | 255 // TouchSelectionControllerClient implementation. |
251 virtual bool SupportsAnimation() const OVERRIDE; | 256 virtual bool SupportsAnimation() const OVERRIDE; |
252 virtual void SetNeedsAnimate() OVERRIDE; | 257 virtual void SetNeedsAnimate() OVERRIDE; |
253 virtual void MoveCaret(const gfx::PointF& position) OVERRIDE; | 258 virtual void MoveCaret(const gfx::PointF& position) OVERRIDE; |
254 virtual void SelectBetweenCoordinates(const gfx::PointF& start, | 259 virtual void SelectBetweenCoordinates(const gfx::PointF& start, |
255 const gfx::PointF& end) OVERRIDE; | 260 const gfx::PointF& end) OVERRIDE; |
256 virtual void OnSelectionEvent(SelectionEventType event, | 261 virtual void OnSelectionEvent(SelectionEventType event, |
257 const gfx::PointF& anchor_position) OVERRIDE; | 262 const gfx::PointF& anchor_position) OVERRIDE; |
258 virtual scoped_ptr<TouchHandleDrawable> CreateDrawable() OVERRIDE; | 263 virtual scoped_ptr<TouchHandleDrawable> CreateDrawable() OVERRIDE; |
259 | 264 |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
310 void InternalSwapCompositorFrame(uint32 output_surface_id, | 315 void InternalSwapCompositorFrame(uint32 output_surface_id, |
311 scoped_ptr<cc::CompositorFrame> frame); | 316 scoped_ptr<cc::CompositorFrame> frame); |
312 | 317 |
313 bool Animate(base::TimeTicks frame_time); | 318 bool Animate(base::TimeTicks frame_time); |
314 | 319 |
315 void OnContentScrollingChange(); | 320 void OnContentScrollingChange(); |
316 bool IsContentScrolling() const; | 321 bool IsContentScrolling() const; |
317 | 322 |
318 float GetDpiScale() const; | 323 float GetDpiScale() const; |
319 | 324 |
| 325 // type is a bit field containing one or more VSyncSubscriberType. |
| 326 void SubscribeToVSync(uint32 type); |
| 327 void UnsubscribeToVSync(uint32 type); |
| 328 |
320 // The model object. | 329 // The model object. |
321 RenderWidgetHostImpl* host_; | 330 RenderWidgetHostImpl* host_; |
322 | 331 |
323 // Used to track whether this render widget needs a BeginFrame. | 332 // Used to track whether this render widget needs a BeginFrame. |
324 bool needs_begin_frame_; | 333 bool needs_begin_frame_; |
325 | 334 |
326 bool is_showing_; | 335 bool is_showing_; |
327 | 336 |
328 // ContentViewCoreImpl is our interface to the view system. | 337 // ContentViewCoreImpl is our interface to the view system. |
329 ContentViewCoreImpl* content_view_core_; | 338 ContentViewCoreImpl* content_view_core_; |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
372 | 381 |
373 bool flush_input_requested_; | 382 bool flush_input_requested_; |
374 | 383 |
375 int accelerated_surface_route_id_; | 384 int accelerated_surface_route_id_; |
376 | 385 |
377 // Size to use if we have no backing ContentViewCore | 386 // Size to use if we have no backing ContentViewCore |
378 gfx::Size default_size_; | 387 gfx::Size default_size_; |
379 | 388 |
380 const bool using_synchronous_compositor_; | 389 const bool using_synchronous_compositor_; |
381 | 390 |
| 391 uint32 vsync_subscribers_bitmask_; |
| 392 |
382 scoped_ptr<DelegatedFrameEvictor> frame_evictor_; | 393 scoped_ptr<DelegatedFrameEvictor> frame_evictor_; |
383 | 394 |
384 size_t locks_on_frame_count_; | 395 size_t locks_on_frame_count_; |
385 bool observing_root_window_; | |
386 | 396 |
387 struct LastFrameInfo { | 397 struct LastFrameInfo { |
388 LastFrameInfo(uint32 output_id, | 398 LastFrameInfo(uint32 output_id, |
389 scoped_ptr<cc::CompositorFrame> output_frame); | 399 scoped_ptr<cc::CompositorFrame> output_frame); |
390 ~LastFrameInfo(); | 400 ~LastFrameInfo(); |
391 uint32 output_surface_id; | 401 uint32 output_surface_id; |
392 scoped_ptr<cc::CompositorFrame> frame; | 402 scoped_ptr<cc::CompositorFrame> frame; |
393 }; | 403 }; |
394 | 404 |
395 scoped_ptr<LastFrameInfo> last_frame_info_; | 405 scoped_ptr<LastFrameInfo> last_frame_info_; |
396 | 406 |
397 TextSurroundingSelectionCallback text_surrounding_selection_callback_; | 407 TextSurroundingSelectionCallback text_surrounding_selection_callback_; |
398 | 408 |
399 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewAndroid); | 409 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewAndroid); |
400 }; | 410 }; |
401 | 411 |
402 } // namespace content | 412 } // namespace content |
403 | 413 |
404 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_ANDROID_H_ | 414 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_ANDROID_H_ |
OLD | NEW |