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 <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 InputEventAckState ack_result) override; | 141 InputEventAckState ack_result) override; |
142 InputEventAckState FilterInputEvent( | 142 InputEventAckState FilterInputEvent( |
143 const blink::WebInputEvent& input_event) override; | 143 const blink::WebInputEvent& input_event) override; |
144 void OnSetNeedsFlushInput() override; | 144 void OnSetNeedsFlushInput() override; |
145 void GestureEventAck(const blink::WebGestureEvent& event, | 145 void GestureEventAck(const blink::WebGestureEvent& event, |
146 InputEventAckState ack_result) override; | 146 InputEventAckState ack_result) override; |
147 BrowserAccessibilityManager* CreateBrowserAccessibilityManager( | 147 BrowserAccessibilityManager* CreateBrowserAccessibilityManager( |
148 BrowserAccessibilityDelegate* delegate, bool for_root_frame) override; | 148 BrowserAccessibilityDelegate* delegate, bool for_root_frame) override; |
149 bool LockMouse() override; | 149 bool LockMouse() override; |
150 void UnlockMouse() override; | 150 void UnlockMouse() override; |
151 void OnSwapCompositorFrame( | 151 void OnSwapCompositorFrame(uint32_t output_surface_id, |
152 uint32_t output_surface_id, | 152 cc::CompositorFrame frame) override; |
153 std::unique_ptr<cc::CompositorFrame> frame) override; | |
154 void ClearCompositorFrame() override; | 153 void ClearCompositorFrame() override; |
155 void DidOverscroll(const DidOverscrollParams& params) override; | 154 void DidOverscroll(const DidOverscrollParams& params) override; |
156 void DidStopFlinging() override; | 155 void DidStopFlinging() override; |
157 uint32_t GetSurfaceIdNamespace() override; | 156 uint32_t GetSurfaceIdNamespace() override; |
158 void ShowDisambiguationPopup(const gfx::Rect& rect_pixels, | 157 void ShowDisambiguationPopup(const gfx::Rect& rect_pixels, |
159 const SkBitmap& zoomed_bitmap) override; | 158 const SkBitmap& zoomed_bitmap) override; |
160 std::unique_ptr<SyntheticGestureTarget> CreateSyntheticGestureTarget() | 159 std::unique_ptr<SyntheticGestureTarget> CreateSyntheticGestureTarget() |
161 override; | 160 override; |
162 void LockCompositingSurface() override; | 161 void LockCompositingSurface() override; |
163 void UnlockCompositingSurface() override; | 162 void UnlockCompositingSurface() override; |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
240 scoped_refptr<cc::Layer> CreateDelegatedLayer() const; | 239 scoped_refptr<cc::Layer> CreateDelegatedLayer() const; |
241 | 240 |
242 bool HasValidFrame() const; | 241 bool HasValidFrame() const; |
243 | 242 |
244 void MoveCaret(const gfx::Point& point); | 243 void MoveCaret(const gfx::Point& point); |
245 void DismissTextHandles(); | 244 void DismissTextHandles(); |
246 void SetTextHandlesTemporarilyHidden(bool hidden); | 245 void SetTextHandlesTemporarilyHidden(bool hidden); |
247 void OnShowingPastePopup(const gfx::PointF& point); | 246 void OnShowingPastePopup(const gfx::PointF& point); |
248 void OnShowUnhandledTapUIIfNeeded(int x_dip, int y_dip); | 247 void OnShowUnhandledTapUIIfNeeded(int x_dip, int y_dip); |
249 | 248 |
250 void SynchronousFrameMetadata( | 249 void SynchronousFrameMetadata(cc::CompositorFrameMetadata frame_metadata); |
251 const cc::CompositorFrameMetadata& frame_metadata); | |
252 | 250 |
253 void SetOverlayVideoMode(bool enabled); | 251 void SetOverlayVideoMode(bool enabled); |
254 | 252 |
255 typedef base::Callback< | 253 typedef base::Callback< |
256 void(const base::string16& content, int start_offset, int end_offset)> | 254 void(const base::string16& content, int start_offset, int end_offset)> |
257 TextSurroundingSelectionCallback; | 255 TextSurroundingSelectionCallback; |
258 void SetTextSurroundingSelectionCallback( | 256 void SetTextSurroundingSelectionCallback( |
259 const TextSurroundingSelectionCallback& callback); | 257 const TextSurroundingSelectionCallback& callback); |
260 | 258 |
261 static void OnContextLost(); | 259 static void OnContextLost(); |
262 | 260 |
263 private: | 261 private: |
264 void RunAckCallbacks(cc::SurfaceDrawStatus status); | 262 void RunAckCallbacks(cc::SurfaceDrawStatus status); |
265 | 263 |
266 void DestroyDelegatedContent(); | 264 void DestroyDelegatedContent(); |
267 void CheckOutputSurfaceChanged(uint32_t output_surface_id); | 265 void CheckOutputSurfaceChanged(uint32_t output_surface_id); |
268 void SubmitCompositorFrame(std::unique_ptr<cc::CompositorFrame> frame_data); | 266 void SubmitCompositorFrame(cc::CompositorFrame frame_data); |
269 void SwapDelegatedFrame(uint32_t output_surface_id, | 267 void SwapDelegatedFrame(uint32_t output_surface_id, |
270 std::unique_ptr<cc::CompositorFrame> frame_data); | 268 cc::CompositorFrame frame_data); |
271 void SendDelegatedFrameAck(uint32_t output_surface_id); | 269 void SendDelegatedFrameAck(uint32_t output_surface_id); |
272 void SendReturnedDelegatedResources(uint32_t output_surface_id); | 270 void SendReturnedDelegatedResources(uint32_t output_surface_id); |
273 | 271 |
274 void OnFrameMetadataUpdated( | 272 void OnFrameMetadataUpdated( |
275 const cc::CompositorFrameMetadata& frame_metadata); | 273 const cc::CompositorFrameMetadata& frame_metadata); |
276 | 274 |
277 void ShowInternal(); | 275 void ShowInternal(); |
278 void HideInternal(); | 276 void HideInternal(); |
279 void AttachLayers(); | 277 void AttachLayers(); |
280 void RemoveLayers(); | 278 void RemoveLayers(); |
(...skipping 16 matching lines...) Expand all Loading... |
297 const ReadbackRequestCallback& callback, | 295 const ReadbackRequestCallback& callback, |
298 const SkColorType color_type); | 296 const SkColorType color_type); |
299 | 297 |
300 // If we have locks on a frame during a ContentViewCore swap or a context | 298 // If we have locks on a frame during a ContentViewCore swap or a context |
301 // lost, the frame is no longer valid and we can safely release all the locks. | 299 // lost, the frame is no longer valid and we can safely release all the locks. |
302 // Use this method to release all the locks. | 300 // Use this method to release all the locks. |
303 void ReleaseLocksOnSurface(); | 301 void ReleaseLocksOnSurface(); |
304 | 302 |
305 // Drop any incoming frames from the renderer when there are locks on the | 303 // Drop any incoming frames from the renderer when there are locks on the |
306 // current frame. | 304 // current frame. |
307 void RetainFrame(uint32_t output_surface_id, | 305 void RetainFrame(uint32_t output_surface_id, cc::CompositorFrame frame); |
308 std::unique_ptr<cc::CompositorFrame> frame); | |
309 | 306 |
310 void InternalSwapCompositorFrame(uint32_t output_surface_id, | 307 void InternalSwapCompositorFrame(uint32_t output_surface_id, |
311 std::unique_ptr<cc::CompositorFrame> frame); | 308 cc::CompositorFrame frame); |
312 void OnLostResources(); | 309 void OnLostResources(); |
313 | 310 |
314 enum VSyncRequestType { | 311 enum VSyncRequestType { |
315 FLUSH_INPUT = 1 << 0, | 312 FLUSH_INPUT = 1 << 0, |
316 BEGIN_FRAME = 1 << 1, | 313 BEGIN_FRAME = 1 << 1, |
317 PERSISTENT_BEGIN_FRAME = 1 << 2 | 314 PERSISTENT_BEGIN_FRAME = 1 << 2 |
318 }; | 315 }; |
319 void RequestVSyncUpdate(uint32_t requests); | 316 void RequestVSyncUpdate(uint32_t requests); |
320 void StartObservingRootWindow(); | 317 void StartObservingRootWindow(); |
321 void StopObservingRootWindow(); | 318 void StopObservingRootWindow(); |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
385 | 382 |
386 const bool using_browser_compositor_; | 383 const bool using_browser_compositor_; |
387 std::unique_ptr<SynchronousCompositorHost> sync_compositor_; | 384 std::unique_ptr<SynchronousCompositorHost> sync_compositor_; |
388 | 385 |
389 std::unique_ptr<DelegatedFrameEvictor> frame_evictor_; | 386 std::unique_ptr<DelegatedFrameEvictor> frame_evictor_; |
390 | 387 |
391 size_t locks_on_frame_count_; | 388 size_t locks_on_frame_count_; |
392 bool observing_root_window_; | 389 bool observing_root_window_; |
393 | 390 |
394 struct LastFrameInfo { | 391 struct LastFrameInfo { |
395 LastFrameInfo(uint32_t output_id, | 392 LastFrameInfo(uint32_t output_id, cc::CompositorFrame output_frame); |
396 std::unique_ptr<cc::CompositorFrame> output_frame); | |
397 ~LastFrameInfo(); | 393 ~LastFrameInfo(); |
398 uint32_t output_surface_id; | 394 uint32_t output_surface_id; |
399 std::unique_ptr<cc::CompositorFrame> frame; | 395 cc::CompositorFrame frame; |
400 }; | 396 }; |
401 | 397 |
402 std::unique_ptr<LastFrameInfo> last_frame_info_; | 398 std::unique_ptr<LastFrameInfo> last_frame_info_; |
403 | 399 |
404 TextSurroundingSelectionCallback text_surrounding_selection_callback_; | 400 TextSurroundingSelectionCallback text_surrounding_selection_callback_; |
405 | 401 |
406 // The last scroll offset of the view. | 402 // The last scroll offset of the view. |
407 gfx::Vector2dF last_scroll_offset_; | 403 gfx::Vector2dF last_scroll_offset_; |
408 | 404 |
409 base::WeakPtrFactory<RenderWidgetHostViewAndroid> weak_ptr_factory_; | 405 base::WeakPtrFactory<RenderWidgetHostViewAndroid> weak_ptr_factory_; |
410 | 406 |
411 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewAndroid); | 407 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewAndroid); |
412 }; | 408 }; |
413 | 409 |
414 } // namespace content | 410 } // namespace content |
415 | 411 |
416 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_ANDROID_H_ | 412 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_ANDROID_H_ |
OLD | NEW |