| 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 25 matching lines...) Expand all Loading... |
| 36 } | 36 } |
| 37 | 37 |
| 38 namespace WebKit { | 38 namespace WebKit { |
| 39 class WebExternalTextureLayer; | 39 class WebExternalTextureLayer; |
| 40 class WebTouchEvent; | 40 class WebTouchEvent; |
| 41 class WebMouseEvent; | 41 class WebMouseEvent; |
| 42 } | 42 } |
| 43 | 43 |
| 44 namespace content { | 44 namespace content { |
| 45 class ContentViewCoreImpl; | 45 class ContentViewCoreImpl; |
| 46 class OverscrollGlow; |
| 46 class RenderWidgetHost; | 47 class RenderWidgetHost; |
| 47 class RenderWidgetHostImpl; | 48 class RenderWidgetHostImpl; |
| 48 class SurfaceTextureTransportClient; | 49 class SurfaceTextureTransportClient; |
| 49 struct NativeWebKeyboardEvent; | 50 struct NativeWebKeyboardEvent; |
| 50 | 51 |
| 51 // ----------------------------------------------------------------------------- | 52 // ----------------------------------------------------------------------------- |
| 52 // See comments in render_widget_host_view.h about this class and its members. | 53 // See comments in render_widget_host_view.h about this class and its members. |
| 53 // ----------------------------------------------------------------------------- | 54 // ----------------------------------------------------------------------------- |
| 54 class RenderWidgetHostViewAndroid | 55 class RenderWidgetHostViewAndroid |
| 55 : public RenderWidgetHostViewBase, | 56 : public RenderWidgetHostViewBase, |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 virtual InputEventAckState FilterInputEvent( | 146 virtual InputEventAckState FilterInputEvent( |
| 146 const WebKit::WebInputEvent& input_event) OVERRIDE; | 147 const WebKit::WebInputEvent& input_event) OVERRIDE; |
| 147 virtual void OnAccessibilityNotifications( | 148 virtual void OnAccessibilityNotifications( |
| 148 const std::vector<AccessibilityHostMsg_NotificationParams>& | 149 const std::vector<AccessibilityHostMsg_NotificationParams>& |
| 149 params) OVERRIDE; | 150 params) OVERRIDE; |
| 150 virtual bool LockMouse() OVERRIDE; | 151 virtual bool LockMouse() OVERRIDE; |
| 151 virtual void UnlockMouse() OVERRIDE; | 152 virtual void UnlockMouse() OVERRIDE; |
| 152 virtual void HasTouchEventHandlers(bool need_touch_events) OVERRIDE; | 153 virtual void HasTouchEventHandlers(bool need_touch_events) OVERRIDE; |
| 153 virtual void OnSwapCompositorFrame( | 154 virtual void OnSwapCompositorFrame( |
| 154 scoped_ptr<cc::CompositorFrame> frame) OVERRIDE; | 155 scoped_ptr<cc::CompositorFrame> frame) OVERRIDE; |
| 156 virtual void OnOverscrolled(gfx::Vector2dF accumulated_overscroll, |
| 157 gfx::Vector2dF current_fling_velocity) OVERRIDE; |
| 155 virtual void ShowDisambiguationPopup(const gfx::Rect& target_rect, | 158 virtual void ShowDisambiguationPopup(const gfx::Rect& target_rect, |
| 156 const SkBitmap& zoomed_bitmap) OVERRIDE; | 159 const SkBitmap& zoomed_bitmap) OVERRIDE; |
| 157 virtual SmoothScrollGesture* CreateSmoothScrollGesture( | 160 virtual SmoothScrollGesture* CreateSmoothScrollGesture( |
| 158 bool scroll_down, int pixels_to_scroll, int mouse_event_x, | 161 bool scroll_down, int pixels_to_scroll, int mouse_event_x, |
| 159 int mouse_event_y) OVERRIDE; | 162 int mouse_event_y) OVERRIDE; |
| 160 | 163 |
| 161 // cc::TextureLayerClient implementation. | 164 // cc::TextureLayerClient implementation. |
| 162 virtual unsigned PrepareTexture(cc::ResourceUpdateQueue* queue) OVERRIDE; | 165 virtual unsigned PrepareTexture(cc::ResourceUpdateQueue* queue) OVERRIDE; |
| 163 virtual WebKit::WebGraphicsContext3D* Context3d() OVERRIDE; | 166 virtual WebKit::WebGraphicsContext3D* Context3d() OVERRIDE; |
| 164 virtual bool PrepareTextureMailbox(cc::TextureMailbox* mailbox) OVERRIDE; | 167 virtual bool PrepareTextureMailbox(cc::TextureMailbox* mailbox) OVERRIDE; |
| (...skipping 26 matching lines...) Expand all Loading... |
| 191 bool HasValidFrame() const; | 194 bool HasValidFrame() const; |
| 192 | 195 |
| 193 // Select all text between the given coordinates. | 196 // Select all text between the given coordinates. |
| 194 void SelectRange(const gfx::Point& start, const gfx::Point& end); | 197 void SelectRange(const gfx::Point& start, const gfx::Point& end); |
| 195 | 198 |
| 196 void MoveCaret(const gfx::Point& point); | 199 void MoveCaret(const gfx::Point& point); |
| 197 | 200 |
| 198 void RequestContentClipping(const gfx::Rect& clipping, | 201 void RequestContentClipping(const gfx::Rect& clipping, |
| 199 const gfx::Size& content_size); | 202 const gfx::Size& content_size); |
| 200 | 203 |
| 204 // Returns true when animation ticks are still needed. This avoids a separate |
| 205 // round-trip for requesting follow-up animation. |
| 206 bool Animate(base::TimeTicks frame_time); |
| 207 |
| 201 private: | 208 private: |
| 202 void BuffersSwapped(const gpu::Mailbox& mailbox, | 209 void BuffersSwapped(const gpu::Mailbox& mailbox, |
| 203 const base::Closure& ack_callback); | 210 const base::Closure& ack_callback); |
| 204 | 211 |
| 205 void RunAckCallbacks(); | 212 void RunAckCallbacks(); |
| 206 | 213 |
| 207 void SwapDelegatedFrame(scoped_ptr<cc::DelegatedFrameData> frame_data); | 214 void SwapDelegatedFrame(scoped_ptr<cc::DelegatedFrameData> frame_data); |
| 208 void SendDelegatedFrameAck(); | 215 void SendDelegatedFrameAck(); |
| 209 | 216 |
| 210 void ComputeContentsSize(const cc::CompositorFrame* frame); | 217 void ComputeContentsSize(const cc::CompositorFrame* frame); |
| 211 void ResetClipping(); | 218 void ResetClipping(); |
| 212 void ClipContents(const gfx::Rect& clipping, const gfx::Size& content_size); | 219 void ClipContents(const gfx::Rect& clipping, const gfx::Size& content_size); |
| 213 | 220 |
| 221 void AttachLayers(); |
| 222 void RemoveLayers(); |
| 223 |
| 224 void UpdateAnimationSize(const cc::CompositorFrame* frame); |
| 225 void ScheduleAnimationIfNecessary(); |
| 226 |
| 214 // The model object. | 227 // The model object. |
| 215 RenderWidgetHostImpl* host_; | 228 RenderWidgetHostImpl* host_; |
| 216 | 229 |
| 217 // Whether or not this widget is potentially attached to the view hierarchy. | 230 // Whether or not this widget is potentially attached to the view hierarchy. |
| 218 // This view may not actually be attached if this is true, but it should be | 231 // This view may not actually be attached if this is true, but it should be |
| 219 // treated as such, because as soon as a ContentViewCore is set the layer | 232 // treated as such, because as soon as a ContentViewCore is set the layer |
| 220 // will be attached automatically. | 233 // will be attached automatically. |
| 221 bool is_layer_attached_; | 234 bool are_layers_attached_; |
| 222 | 235 |
| 223 // ContentViewCoreImpl is our interface to the view system. | 236 // ContentViewCoreImpl is our interface to the view system. |
| 224 ContentViewCoreImpl* content_view_core_; | 237 ContentViewCoreImpl* content_view_core_; |
| 225 | 238 |
| 226 ImeAdapterAndroid ime_adapter_android_; | 239 ImeAdapterAndroid ime_adapter_android_; |
| 227 | 240 |
| 228 // Body background color of the underlying document. | 241 // Body background color of the underlying document. |
| 229 SkColor cached_background_color_; | 242 SkColor cached_background_color_; |
| 230 | 243 |
| 231 // The texture layer for this view when using browser-side compositing. | 244 // The texture layer for this view when using browser-side compositing. |
| (...skipping 21 matching lines...) Expand all Loading... |
| 253 // The mailbox of the previously received frame. | 266 // The mailbox of the previously received frame. |
| 254 gpu::Mailbox current_mailbox_; | 267 gpu::Mailbox current_mailbox_; |
| 255 | 268 |
| 256 // The mailbox of the frame we last returned. | 269 // The mailbox of the frame we last returned. |
| 257 gpu::Mailbox last_mailbox_; | 270 gpu::Mailbox last_mailbox_; |
| 258 | 271 |
| 259 base::WeakPtrFactory<RenderWidgetHostViewAndroid> weak_ptr_factory_; | 272 base::WeakPtrFactory<RenderWidgetHostViewAndroid> weak_ptr_factory_; |
| 260 | 273 |
| 261 std::queue<base::Closure> ack_callbacks_; | 274 std::queue<base::Closure> ack_callbacks_; |
| 262 | 275 |
| 276 // Used to render overscroll overlays. |
| 277 scoped_ptr<OverscrollGlow> overscroll_effect_; |
| 278 |
| 263 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewAndroid); | 279 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewAndroid); |
| 264 }; | 280 }; |
| 265 | 281 |
| 266 } // namespace content | 282 } // namespace content |
| 267 | 283 |
| 268 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_ANDROID_H_ | 284 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_ANDROID_H_ |
| OLD | NEW |