| 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_BASE_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_BASE_H_ |
| 6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_BASE_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_BASE_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 bool IsShowingContextMenu() const override; | 81 bool IsShowingContextMenu() const override; |
| 82 void SetShowingContextMenu(bool showing_menu) override; | 82 void SetShowingContextMenu(bool showing_menu) override; |
| 83 base::string16 GetSelectedText() const override; | 83 base::string16 GetSelectedText() const override; |
| 84 bool IsMouseLocked() override; | 84 bool IsMouseLocked() override; |
| 85 gfx::Size GetVisibleViewportSize() const override; | 85 gfx::Size GetVisibleViewportSize() const override; |
| 86 void SetInsets(const gfx::Insets& insets) override; | 86 void SetInsets(const gfx::Insets& insets) override; |
| 87 void BeginFrameSubscription( | 87 void BeginFrameSubscription( |
| 88 scoped_ptr<RenderWidgetHostViewFrameSubscriber> subscriber) override; | 88 scoped_ptr<RenderWidgetHostViewFrameSubscriber> subscriber) override; |
| 89 void EndFrameSubscription() override; | 89 void EndFrameSubscription() override; |
| 90 | 90 |
| 91 // This only needs to be overridden by RenderWidgetHostViewBase subclasses |
| 92 // that handle content embedded within other RenderWidgetHostViews. |
| 93 gfx::Point TransformPointToRootCoordSpace(const gfx::Point& point) override; |
| 94 gfx::PointF TransformPointToRootCoordSpaceF( |
| 95 const gfx::PointF& point) override; |
| 96 |
| 91 // IPC::Listener implementation: | 97 // IPC::Listener implementation: |
| 92 bool OnMessageReceived(const IPC::Message& msg) override; | 98 bool OnMessageReceived(const IPC::Message& msg) override; |
| 93 | 99 |
| 94 void SetPopupType(blink::WebPopupType popup_type); | 100 void SetPopupType(blink::WebPopupType popup_type); |
| 95 | 101 |
| 96 blink::WebPopupType GetPopupType(); | 102 blink::WebPopupType GetPopupType(); |
| 97 | 103 |
| 98 // Return a value that is incremented each time the renderer swaps a new frame | 104 // Return a value that is incremented each time the renderer swaps a new frame |
| 99 // to the view. | 105 // to the view. |
| 100 uint32_t RendererFrameNumber(); | 106 uint32_t RendererFrameNumber(); |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 197 // properly handle the event (i.e. it has focus for keyboard events, or has | 203 // properly handle the event (i.e. it has focus for keyboard events, or has |
| 198 // been identified by hit testing mouse, touch or gesture events). | 204 // been identified by hit testing mouse, touch or gesture events). |
| 199 virtual uint32_t SurfaceIdNamespaceAtPoint(const gfx::Point& point, | 205 virtual uint32_t SurfaceIdNamespaceAtPoint(const gfx::Point& point, |
| 200 gfx::Point* transformed_point); | 206 gfx::Point* transformed_point); |
| 201 virtual void ProcessKeyboardEvent(const NativeWebKeyboardEvent& event) {} | 207 virtual void ProcessKeyboardEvent(const NativeWebKeyboardEvent& event) {} |
| 202 virtual void ProcessMouseEvent(const blink::WebMouseEvent& event) {} | 208 virtual void ProcessMouseEvent(const blink::WebMouseEvent& event) {} |
| 203 virtual void ProcessMouseWheelEvent(const blink::WebMouseWheelEvent& event) {} | 209 virtual void ProcessMouseWheelEvent(const blink::WebMouseWheelEvent& event) {} |
| 204 virtual void ProcessTouchEvent(const blink::WebTouchEvent& event, | 210 virtual void ProcessTouchEvent(const blink::WebTouchEvent& event, |
| 205 const ui::LatencyInfo& latency) {} | 211 const ui::LatencyInfo& latency) {} |
| 206 | 212 |
| 207 // If a RenderWidgetHost is dealing with points that are transformed from the | |
| 208 // root frame for a page (i.e. because its content is contained within | |
| 209 // that of another RenderWidgetHost), this provides a facility to convert | |
| 210 // a point from its own coordinate space to that of the root frame. | |
| 211 // This only needs to be overriden by RenderWidgetHostView subclasses | |
| 212 // that handle content embedded within other RenderWidgetHostViews. | |
| 213 virtual void TransformPointToRootCoordSpace(const gfx::Point& point, | |
| 214 gfx::Point* transformed_point); | |
| 215 | |
| 216 // Transform a point that is in the coordinate space of a Surface that is | 213 // Transform a point that is in the coordinate space of a Surface that is |
| 217 // embedded within the RenderWidgetHostViewBase's Surface to the | 214 // embedded within the RenderWidgetHostViewBase's Surface to the |
| 218 // coordinate space of the embedding Surface. Typically this means that a | 215 // coordinate space of the embedding Surface. Typically this means that a |
| 219 // point was received from an out-of-process iframe's RenderWidget and needs | 216 // point was received from an out-of-process iframe's RenderWidget and needs |
| 220 // to be translated to viewport coordinates for the root RWHV, in which case | 217 // to be translated to viewport coordinates for the root RWHV, in which case |
| 221 // this method is called on the root RWHV with the out-of-process iframe's | 218 // this method is called on the root RWHV with the out-of-process iframe's |
| 222 // SurfaceId. | 219 // SurfaceId. |
| 223 virtual void TransformPointToLocalCoordSpace(const gfx::Point& point, | 220 virtual void TransformPointToLocalCoordSpace(const gfx::Point& point, |
| 224 cc::SurfaceId original_surface, | 221 cc::SurfaceId original_surface, |
| 225 gfx::Point* transformed_point); | 222 gfx::Point* transformed_point); |
| (...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 448 base::OneShotTimer flush_input_timer_; | 445 base::OneShotTimer flush_input_timer_; |
| 449 | 446 |
| 450 base::WeakPtrFactory<RenderWidgetHostViewBase> weak_factory_; | 447 base::WeakPtrFactory<RenderWidgetHostViewBase> weak_factory_; |
| 451 | 448 |
| 452 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewBase); | 449 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewBase); |
| 453 }; | 450 }; |
| 454 | 451 |
| 455 } // namespace content | 452 } // namespace content |
| 456 | 453 |
| 457 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_BASE_H_ | 454 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_BASE_H_ |
| OLD | NEW |