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 { INPUT = 1 << 0, BEGIN_FRAME = 1 << 1 }; | |
boliu
2014/08/20 20:30:00
nit: separate lines (unless this is what clang-for
| |
251 | |
250 // TouchSelectionControllerClient implementation. | 252 // TouchSelectionControllerClient implementation. |
251 virtual bool SupportsAnimation() const OVERRIDE; | 253 virtual bool SupportsAnimation() const OVERRIDE; |
252 virtual void SetNeedsAnimate() OVERRIDE; | 254 virtual void SetNeedsAnimate() OVERRIDE; |
253 virtual void MoveCaret(const gfx::PointF& position) OVERRIDE; | 255 virtual void MoveCaret(const gfx::PointF& position) OVERRIDE; |
254 virtual void SelectBetweenCoordinates(const gfx::PointF& start, | 256 virtual void SelectBetweenCoordinates(const gfx::PointF& start, |
255 const gfx::PointF& end) OVERRIDE; | 257 const gfx::PointF& end) OVERRIDE; |
256 virtual void OnSelectionEvent(SelectionEventType event, | 258 virtual void OnSelectionEvent(SelectionEventType event, |
257 const gfx::PointF& anchor_position) OVERRIDE; | 259 const gfx::PointF& anchor_position) OVERRIDE; |
258 virtual scoped_ptr<TouchHandleDrawable> CreateDrawable() OVERRIDE; | 260 virtual scoped_ptr<TouchHandleDrawable> CreateDrawable() OVERRIDE; |
259 | 261 |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
310 void InternalSwapCompositorFrame(uint32 output_surface_id, | 312 void InternalSwapCompositorFrame(uint32 output_surface_id, |
311 scoped_ptr<cc::CompositorFrame> frame); | 313 scoped_ptr<cc::CompositorFrame> frame); |
312 | 314 |
313 bool Animate(base::TimeTicks frame_time); | 315 bool Animate(base::TimeTicks frame_time); |
314 | 316 |
315 void OnContentScrollingChange(); | 317 void OnContentScrollingChange(); |
316 bool IsContentScrolling() const; | 318 bool IsContentScrolling() const; |
317 | 319 |
318 float GetDpiScale() const; | 320 float GetDpiScale() const; |
319 | 321 |
322 // type is a bit field containing one or more VSyncSubscriberType. | |
323 void SubscribeToVSync(uint32 type); | |
324 void UnsubscribeToVSync(uint32 type); | |
325 bool IsSubscribedToType(uint32 type); | |
326 | |
320 // The model object. | 327 // The model object. |
321 RenderWidgetHostImpl* host_; | 328 RenderWidgetHostImpl* host_; |
322 | 329 |
323 // Used to track whether this render widget needs a BeginFrame. | |
324 bool needs_begin_frame_; | |
325 | |
326 bool is_showing_; | 330 bool is_showing_; |
327 | 331 |
328 // ContentViewCoreImpl is our interface to the view system. | 332 // ContentViewCoreImpl is our interface to the view system. |
329 ContentViewCoreImpl* content_view_core_; | 333 ContentViewCoreImpl* content_view_core_; |
330 | 334 |
331 ImeAdapterAndroid ime_adapter_android_; | 335 ImeAdapterAndroid ime_adapter_android_; |
332 | 336 |
333 // Body background color of the underlying document. | 337 // Body background color of the underlying document. |
334 SkColor cached_background_color_; | 338 SkColor cached_background_color_; |
335 | 339 |
(...skipping 27 matching lines...) Expand all Loading... | |
363 | 367 |
364 // Handles gesture based text selection | 368 // Handles gesture based text selection |
365 GestureTextSelector gesture_text_selector_; | 369 GestureTextSelector gesture_text_selector_; |
366 | 370 |
367 // Manages selection handle rendering and manipulation. | 371 // Manages selection handle rendering and manipulation. |
368 // This will always be NULL if |content_view_core_| is NULL. | 372 // This will always be NULL if |content_view_core_| is NULL. |
369 scoped_ptr<TouchSelectionController> selection_controller_; | 373 scoped_ptr<TouchSelectionController> selection_controller_; |
370 bool touch_scrolling_; | 374 bool touch_scrolling_; |
371 size_t potentially_active_fling_count_; | 375 size_t potentially_active_fling_count_; |
372 | 376 |
373 bool flush_input_requested_; | |
374 | |
375 int accelerated_surface_route_id_; | 377 int accelerated_surface_route_id_; |
376 | 378 |
377 // Size to use if we have no backing ContentViewCore | 379 // Size to use if we have no backing ContentViewCore |
378 gfx::Size default_size_; | 380 gfx::Size default_size_; |
379 | 381 |
380 const bool using_synchronous_compositor_; | 382 const bool using_synchronous_compositor_; |
381 | 383 |
384 // Used to track how VSync should be dispatched. For example, if this bit | |
385 // mask has BEGIN_FRAME bit on, a new frame will be requested during OnVSync. | |
386 uint32 vsync_subscribers_bitmask_; | |
387 | |
382 scoped_ptr<DelegatedFrameEvictor> frame_evictor_; | 388 scoped_ptr<DelegatedFrameEvictor> frame_evictor_; |
383 | 389 |
384 size_t locks_on_frame_count_; | 390 size_t locks_on_frame_count_; |
385 bool observing_root_window_; | |
386 | 391 |
387 struct LastFrameInfo { | 392 struct LastFrameInfo { |
388 LastFrameInfo(uint32 output_id, | 393 LastFrameInfo(uint32 output_id, |
389 scoped_ptr<cc::CompositorFrame> output_frame); | 394 scoped_ptr<cc::CompositorFrame> output_frame); |
390 ~LastFrameInfo(); | 395 ~LastFrameInfo(); |
391 uint32 output_surface_id; | 396 uint32 output_surface_id; |
392 scoped_ptr<cc::CompositorFrame> frame; | 397 scoped_ptr<cc::CompositorFrame> frame; |
393 }; | 398 }; |
394 | 399 |
395 scoped_ptr<LastFrameInfo> last_frame_info_; | 400 scoped_ptr<LastFrameInfo> last_frame_info_; |
396 | 401 |
397 TextSurroundingSelectionCallback text_surrounding_selection_callback_; | 402 TextSurroundingSelectionCallback text_surrounding_selection_callback_; |
398 | 403 |
399 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewAndroid); | 404 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewAndroid); |
400 }; | 405 }; |
401 | 406 |
402 } // namespace content | 407 } // namespace content |
403 | 408 |
404 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_ANDROID_H_ | 409 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_ANDROID_H_ |
OLD | NEW |