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 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
188 // cc::SurfaceFactoryClient implementation. | 188 // cc::SurfaceFactoryClient implementation. |
189 void ReturnResources(const cc::ReturnedResourceArray& resources) override; | 189 void ReturnResources(const cc::ReturnedResourceArray& resources) override; |
190 | 190 |
191 // ui::GestureProviderClient implementation. | 191 // ui::GestureProviderClient implementation. |
192 void OnGestureEvent(const ui::GestureEventData& gesture) override; | 192 void OnGestureEvent(const ui::GestureEventData& gesture) override; |
193 | 193 |
194 // ui::WindowAndroidObserver implementation. | 194 // ui::WindowAndroidObserver implementation. |
195 void OnCompositingDidCommit() override; | 195 void OnCompositingDidCommit() override; |
196 void OnAttachCompositor() override; | 196 void OnAttachCompositor() override; |
197 void OnDetachCompositor() override; | 197 void OnDetachCompositor() override; |
| 198 void OnVisibilityChanged(bool visible) override; |
198 void OnVSync(base::TimeTicks frame_time, | 199 void OnVSync(base::TimeTicks frame_time, |
199 base::TimeDelta vsync_period) override; | 200 base::TimeDelta vsync_period) override; |
200 void OnAnimate(base::TimeTicks begin_frame_time) override; | 201 void OnAnimate(base::TimeTicks begin_frame_time) override; |
| 202 void OnActivityPaused() override; |
| 203 void OnActivityResumed() override; |
201 | 204 |
202 // DelegatedFrameEvictor implementation | 205 // DelegatedFrameEvictor implementation |
203 void EvictDelegatedFrame() override; | 206 void EvictDelegatedFrame() override; |
204 | 207 |
205 SkColorType PreferredReadbackFormat() override; | 208 SkColorType PreferredReadbackFormat() override; |
206 | 209 |
207 // StylusTextSelectorClient implementation. | 210 // StylusTextSelectorClient implementation. |
208 void OnStylusSelectBegin(float x0, float y0, float x1, float y1) override; | 211 void OnStylusSelectBegin(float x0, float y0, float x1, float y1) override; |
209 void OnStylusSelectUpdate(float x, float y) override; | 212 void OnStylusSelectUpdate(float x, float y) override; |
210 void OnStylusSelectEnd() override; | 213 void OnStylusSelectEnd() override; |
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
402 // Size to use if we have no backing ContentViewCore | 405 // Size to use if we have no backing ContentViewCore |
403 gfx::Size default_size_; | 406 gfx::Size default_size_; |
404 | 407 |
405 const bool using_browser_compositor_; | 408 const bool using_browser_compositor_; |
406 | 409 |
407 scoped_ptr<DelegatedFrameEvictor> frame_evictor_; | 410 scoped_ptr<DelegatedFrameEvictor> frame_evictor_; |
408 | 411 |
409 size_t locks_on_frame_count_; | 412 size_t locks_on_frame_count_; |
410 bool observing_root_window_; | 413 bool observing_root_window_; |
411 | 414 |
| 415 // If the activity is paused while the widget is visible, lock the |
| 416 // surface. This ensures that visual content is seamlessly preserved until |
| 417 // either window visibility is lost (e.g., when the activity is backgrounded), |
| 418 // or the activity resumes. |
| 419 bool should_unlock_surface_on_visibility_lost_or_activity_resumed_; |
| 420 |
412 struct LastFrameInfo { | 421 struct LastFrameInfo { |
413 LastFrameInfo(uint32 output_id, | 422 LastFrameInfo(uint32 output_id, |
414 scoped_ptr<cc::CompositorFrame> output_frame); | 423 scoped_ptr<cc::CompositorFrame> output_frame); |
415 ~LastFrameInfo(); | 424 ~LastFrameInfo(); |
416 uint32 output_surface_id; | 425 uint32 output_surface_id; |
417 scoped_ptr<cc::CompositorFrame> frame; | 426 scoped_ptr<cc::CompositorFrame> frame; |
418 }; | 427 }; |
419 | 428 |
420 scoped_ptr<LastFrameInfo> last_frame_info_; | 429 scoped_ptr<LastFrameInfo> last_frame_info_; |
421 | 430 |
422 TextSurroundingSelectionCallback text_surrounding_selection_callback_; | 431 TextSurroundingSelectionCallback text_surrounding_selection_callback_; |
423 | 432 |
424 // List of readbackrequests waiting for arrival of a valid frame. | 433 // List of readbackrequests waiting for arrival of a valid frame. |
425 std::queue<ReadbackRequest> readbacks_waiting_for_frame_; | 434 std::queue<ReadbackRequest> readbacks_waiting_for_frame_; |
426 | 435 |
427 // The last scroll offset of the view. | 436 // The last scroll offset of the view. |
428 gfx::Vector2dF last_scroll_offset_; | 437 gfx::Vector2dF last_scroll_offset_; |
429 | 438 |
430 base::WeakPtrFactory<RenderWidgetHostViewAndroid> weak_ptr_factory_; | 439 base::WeakPtrFactory<RenderWidgetHostViewAndroid> weak_ptr_factory_; |
431 | 440 |
432 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewAndroid); | 441 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewAndroid); |
433 }; | 442 }; |
434 | 443 |
435 } // namespace content | 444 } // namespace content |
436 | 445 |
437 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_ANDROID_H_ | 446 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_ANDROID_H_ |
OLD | NEW |