| 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 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 virtual void OnSwapCompositorFrame( | 167 virtual void OnSwapCompositorFrame( |
| 168 uint32 output_surface_id, | 168 uint32 output_surface_id, |
| 169 scoped_ptr<cc::CompositorFrame> frame) OVERRIDE; | 169 scoped_ptr<cc::CompositorFrame> frame) OVERRIDE; |
| 170 virtual void OnOverscrolled(gfx::Vector2dF accumulated_overscroll, | 170 virtual void OnOverscrolled(gfx::Vector2dF accumulated_overscroll, |
| 171 gfx::Vector2dF current_fling_velocity) OVERRIDE; | 171 gfx::Vector2dF current_fling_velocity) OVERRIDE; |
| 172 virtual void DidStopFlinging() OVERRIDE; | 172 virtual void DidStopFlinging() OVERRIDE; |
| 173 virtual void ShowDisambiguationPopup(const gfx::Rect& target_rect, | 173 virtual void ShowDisambiguationPopup(const gfx::Rect& target_rect, |
| 174 const SkBitmap& zoomed_bitmap) OVERRIDE; | 174 const SkBitmap& zoomed_bitmap) OVERRIDE; |
| 175 virtual scoped_ptr<SyntheticGestureTarget> CreateSyntheticGestureTarget() | 175 virtual scoped_ptr<SyntheticGestureTarget> CreateSyntheticGestureTarget() |
| 176 OVERRIDE; | 176 OVERRIDE; |
| 177 virtual void LockSurfaceForCopy() OVERRIDE; |
| 178 virtual void UnlockSurfaceForCopy() OVERRIDE; |
| 177 | 179 |
| 178 // Implementation of BrowserAccessibilityDelegate: | 180 // Implementation of BrowserAccessibilityDelegate: |
| 179 virtual void SetAccessibilityFocus(int acc_obj_id) OVERRIDE; | 181 virtual void SetAccessibilityFocus(int acc_obj_id) OVERRIDE; |
| 180 virtual void AccessibilityDoDefaultAction(int acc_obj_id) OVERRIDE; | 182 virtual void AccessibilityDoDefaultAction(int acc_obj_id) OVERRIDE; |
| 181 virtual void AccessibilityScrollToMakeVisible( | 183 virtual void AccessibilityScrollToMakeVisible( |
| 182 int acc_obj_id, gfx::Rect subfocus) OVERRIDE; | 184 int acc_obj_id, gfx::Rect subfocus) OVERRIDE; |
| 183 virtual void AccessibilityScrollToPoint( | 185 virtual void AccessibilityScrollToPoint( |
| 184 int acc_obj_id, gfx::Point point) OVERRIDE; | 186 int acc_obj_id, gfx::Point point) OVERRIDE; |
| 185 virtual void AccessibilitySetTextSelection( | 187 virtual void AccessibilitySetTextSelection( |
| 186 int acc_obj_id, int start_offset, int end_offset) OVERRIDE; | 188 int acc_obj_id, int start_offset, int end_offset) OVERRIDE; |
| (...skipping 23 matching lines...) Expand all Loading... |
| 210 void SendMouseWheelEvent(const blink::WebMouseWheelEvent& event); | 212 void SendMouseWheelEvent(const blink::WebMouseWheelEvent& event); |
| 211 void SendGestureEvent(const blink::WebGestureEvent& event); | 213 void SendGestureEvent(const blink::WebGestureEvent& event); |
| 212 void SendBeginFrame(const cc::BeginFrameArgs& args); | 214 void SendBeginFrame(const cc::BeginFrameArgs& args); |
| 213 | 215 |
| 214 void OnTextInputStateChanged(const ViewHostMsg_TextInputState_Params& params); | 216 void OnTextInputStateChanged(const ViewHostMsg_TextInputState_Params& params); |
| 215 void OnDidChangeBodyBackgroundColor(SkColor color); | 217 void OnDidChangeBodyBackgroundColor(SkColor color); |
| 216 void OnStartContentIntent(const GURL& content_url); | 218 void OnStartContentIntent(const GURL& content_url); |
| 217 void OnSetNeedsBeginFrame(bool enabled); | 219 void OnSetNeedsBeginFrame(bool enabled); |
| 218 void OnSmartClipDataExtracted(const base::string16& result); | 220 void OnSmartClipDataExtracted(const base::string16& result); |
| 219 | 221 |
| 220 void LockResources(); | |
| 221 void UnlockResources(); | |
| 222 | |
| 223 long GetNativeImeAdapter(); | 222 long GetNativeImeAdapter(); |
| 224 | 223 |
| 225 void WasResized(); | 224 void WasResized(); |
| 226 | 225 |
| 227 void GetScaledContentBitmap( | 226 void GetScaledContentBitmap( |
| 228 float scale, | 227 float scale, |
| 229 SkBitmap::Config bitmap_config, | 228 SkBitmap::Config bitmap_config, |
| 230 gfx::Rect src_subrect, | 229 gfx::Rect src_subrect, |
| 231 const base::Callback<void(bool, const SkBitmap&)>& result_callback); | 230 const base::Callback<void(bool, const SkBitmap&)>& result_callback); |
| 232 | 231 |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 287 | 286 |
| 288 // DevTools ScreenCast support for Android WebView. | 287 // DevTools ScreenCast support for Android WebView. |
| 289 void SynchronousCopyContents( | 288 void SynchronousCopyContents( |
| 290 const gfx::Rect& src_subrect_in_pixel, | 289 const gfx::Rect& src_subrect_in_pixel, |
| 291 const gfx::Size& dst_size_in_pixel, | 290 const gfx::Size& dst_size_in_pixel, |
| 292 const base::Callback<void(bool, const SkBitmap&)>& callback, | 291 const base::Callback<void(bool, const SkBitmap&)>& callback, |
| 293 const SkBitmap::Config config); | 292 const SkBitmap::Config config); |
| 294 | 293 |
| 295 bool IsReadbackConfigSupported(SkBitmap::Config bitmap_config); | 294 bool IsReadbackConfigSupported(SkBitmap::Config bitmap_config); |
| 296 | 295 |
| 296 // If we have locks on a frame during a ContentViewCore swap or a context |
| 297 // lost, the frame is no longer valid and we can safely release all the locks. |
| 298 // Use this method to release all the locks. |
| 299 void ReleaseLocksOnSurface(); |
| 300 |
| 301 // Drop any incoming frames from the renderer when there are locks on the |
| 302 // current frame. |
| 303 void RetainFrame(uint32 output_surface_id, |
| 304 scoped_ptr<cc::CompositorFrame> frame); |
| 305 |
| 306 void InternalSwapCompositorFrame(uint32 output_surface_id, |
| 307 scoped_ptr<cc::CompositorFrame> frame); |
| 308 |
| 297 // The model object. | 309 // The model object. |
| 298 RenderWidgetHostImpl* host_; | 310 RenderWidgetHostImpl* host_; |
| 299 | 311 |
| 300 // Used to track whether this render widget needs a BeginFrame. | 312 // Used to track whether this render widget needs a BeginFrame. |
| 301 bool needs_begin_frame_; | 313 bool needs_begin_frame_; |
| 302 | 314 |
| 303 bool is_showing_; | 315 bool is_showing_; |
| 304 | 316 |
| 305 // ContentViewCoreImpl is our interface to the view system. | 317 // ContentViewCoreImpl is our interface to the view system. |
| 306 ContentViewCoreImpl* content_view_core_; | 318 ContentViewCoreImpl* content_view_core_; |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 352 | 364 |
| 353 // Size to use if we have no backing ContentViewCore | 365 // Size to use if we have no backing ContentViewCore |
| 354 gfx::Size default_size_; | 366 gfx::Size default_size_; |
| 355 | 367 |
| 356 const bool using_synchronous_compositor_; | 368 const bool using_synchronous_compositor_; |
| 357 | 369 |
| 358 scoped_ptr<DelegatedFrameEvictor> frame_evictor_; | 370 scoped_ptr<DelegatedFrameEvictor> frame_evictor_; |
| 359 | 371 |
| 360 bool using_delegated_renderer_; | 372 bool using_delegated_renderer_; |
| 361 | 373 |
| 374 size_t locks_on_frame_count_; |
| 375 |
| 376 struct LastFrameInfo { |
| 377 LastFrameInfo(uint32 output_id, |
| 378 scoped_ptr<cc::CompositorFrame> output_frame) |
| 379 : output_surface_id(output_id), frame(output_frame.Pass()) {} |
| 380 |
| 381 uint32 output_surface_id; |
| 382 scoped_ptr<cc::CompositorFrame> frame; |
| 383 }; |
| 384 |
| 385 scoped_ptr<LastFrameInfo> last_frame_info_; |
| 386 |
| 362 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewAndroid); | 387 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewAndroid); |
| 363 }; | 388 }; |
| 364 | 389 |
| 365 } // namespace content | 390 } // namespace content |
| 366 | 391 |
| 367 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_ANDROID_H_ | 392 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_ANDROID_H_ |
| OLD | NEW |