OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_FRAME_HOST_RENDER_WIDGET_HOST_VIEW_CHILD_FRAME_H_ | 5 #ifndef CONTENT_BROWSER_FRAME_HOST_RENDER_WIDGET_HOST_VIEW_CHILD_FRAME_H_ |
6 #define CONTENT_BROWSER_FRAME_HOST_RENDER_WIDGET_HOST_VIEW_CHILD_FRAME_H_ | 6 #define CONTENT_BROWSER_FRAME_HOST_RENDER_WIDGET_HOST_VIEW_CHILD_FRAME_H_ |
7 | 7 |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "cc/resources/returned_resource.h" | 9 #include "cc/resources/returned_resource.h" |
10 #include "cc/surfaces/surface_factory_client.h" | 10 #include "cc/surfaces/surface_factory_client.h" |
11 #include "cc/surfaces/surface_id_allocator.h" | 11 #include "cc/surfaces/surface_id_allocator.h" |
12 #include "content/browser/compositor/image_transport_factory.h" | 12 #include "content/browser/compositor/image_transport_factory.h" |
13 #include "content/browser/renderer_host/render_widget_host_view_base.h" | 13 #include "content/browser/renderer_host/render_widget_host_view_base.h" |
14 #include "content/common/content_export.h" | 14 #include "content/common/content_export.h" |
15 #include "content/public/browser/readback_types.h" | 15 #include "content/public/browser/readback_types.h" |
16 #include "ui/compositor/compositor.h" | 16 #include "ui/compositor/compositor.h" |
17 #include "ui/gfx/geometry/rect.h" | 17 #include "ui/gfx/geometry/rect.h" |
18 #include "ui/gfx/native_widget_types.h" | 18 #include "ui/gfx/native_widget_types.h" |
19 | 19 |
20 namespace cc { | 20 namespace cc { |
21 class SurfaceFactory; | 21 class SurfaceFactory; |
22 enum class SurfaceDrawStatus; | 22 enum class SurfaceDrawStatus; |
23 } | 23 } |
24 | 24 |
25 namespace content { | 25 namespace content { |
26 class CrossProcessFrameConnector; | 26 class CrossProcessFrameConnector; |
27 class RenderWidgetHost; | 27 class RenderWidgetHost; |
28 class RenderWidgetHostImpl; | 28 class RenderWidgetHostImpl; |
29 class RenderWidgetHostViewChildFrameTest; | 29 class RenderWidgetHostViewChildFrameTest; |
| 30 class RenderWidgetHostViewGuestSurfaceTest; |
30 | 31 |
31 // RenderWidgetHostViewChildFrame implements the view for a RenderWidgetHost | 32 // RenderWidgetHostViewChildFrame implements the view for a RenderWidgetHost |
32 // associated with content being rendered in a separate process from | 33 // associated with content being rendered in a separate process from |
33 // content that is embedding it. This is not a platform-specific class; rather, | 34 // content that is embedding it. This is not a platform-specific class; rather, |
34 // the embedding renderer process implements the platform containing the | 35 // the embedding renderer process implements the platform containing the |
35 // widget, and the top-level frame's RenderWidgetHostView will ultimately | 36 // widget, and the top-level frame's RenderWidgetHostView will ultimately |
36 // manage all native widget interaction. | 37 // manage all native widget interaction. |
37 // | 38 // |
38 // See comments in render_widget_host_view.h about this class and its members. | 39 // See comments in render_widget_host_view.h about this class and its members. |
39 class CONTENT_EXPORT RenderWidgetHostViewChildFrame | 40 class CONTENT_EXPORT RenderWidgetHostViewChildFrame |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 void SetParentNativeViewAccessible( | 142 void SetParentNativeViewAccessible( |
142 gfx::NativeViewAccessible accessible_parent) override; | 143 gfx::NativeViewAccessible accessible_parent) override; |
143 gfx::NativeViewId GetParentForWindowlessPlugin() const override; | 144 gfx::NativeViewId GetParentForWindowlessPlugin() const override; |
144 #endif | 145 #endif |
145 BrowserAccessibilityManager* CreateBrowserAccessibilityManager( | 146 BrowserAccessibilityManager* CreateBrowserAccessibilityManager( |
146 BrowserAccessibilityDelegate* delegate) override; | 147 BrowserAccessibilityDelegate* delegate) override; |
147 | 148 |
148 // cc::SurfaceFactoryClient implementation. | 149 // cc::SurfaceFactoryClient implementation. |
149 void ReturnResources(const cc::ReturnedResourceArray& resources) override; | 150 void ReturnResources(const cc::ReturnedResourceArray& resources) override; |
150 | 151 |
| 152 // Declared 'public' instead of 'protected' here to allow derived classes |
| 153 // to Bind() to it. |
| 154 void SurfaceDrawn(uint32 output_surface_id, cc::SurfaceDrawStatus drawn); |
| 155 |
151 protected: | 156 protected: |
152 friend class RenderWidgetHostView; | 157 friend class RenderWidgetHostView; |
153 friend class RenderWidgetHostViewChildFrameTest; | 158 friend class RenderWidgetHostViewChildFrameTest; |
154 | 159 friend class RenderWidgetHostViewGuestSurfaceTest; |
155 void SurfaceDrawn(uint32 output_surface_id, cc::SurfaceDrawStatus drawn); | |
156 | 160 |
157 // The last scroll offset of the view. | 161 // The last scroll offset of the view. |
158 gfx::Vector2dF last_scroll_offset_; | 162 gfx::Vector2dF last_scroll_offset_; |
159 | 163 |
160 // Members will become private when RenderWidgetHostViewGuest is removed. | 164 // Members will become private when RenderWidgetHostViewGuest is removed. |
161 // The model object. | 165 // The model object. |
162 RenderWidgetHostImpl* host_; | 166 RenderWidgetHostImpl* host_; |
163 | 167 |
164 // Flag determining whether we render into a compositing Surface. | 168 // Flag determining whether we render into a compositing Surface. |
165 bool use_surfaces_; | 169 bool use_surfaces_; |
166 | 170 |
167 // Surface-related state. | 171 // Surface-related state. |
168 scoped_ptr<cc::SurfaceIdAllocator> id_allocator_; | 172 scoped_ptr<cc::SurfaceIdAllocator> id_allocator_; |
169 scoped_ptr<cc::SurfaceFactory> surface_factory_; | 173 scoped_ptr<cc::SurfaceFactory> surface_factory_; |
170 cc::SurfaceId surface_id_; | 174 cc::SurfaceId surface_id_; |
171 uint32 next_surface_sequence_; | 175 uint32 next_surface_sequence_; |
172 uint32 last_output_surface_id_; | 176 uint32 last_output_surface_id_; |
173 gfx::Size current_surface_size_; | 177 gfx::Size current_surface_size_; |
174 float current_surface_scale_factor_; | 178 float current_surface_scale_factor_; |
175 uint32 ack_pending_count_; | 179 uint32 ack_pending_count_; |
176 cc::ReturnedResourceArray surface_returned_resources_; | 180 cc::ReturnedResourceArray surface_returned_resources_; |
177 | 181 |
178 // frame_connector_ provides a platform abstraction. Messages | 182 // frame_connector_ provides a platform abstraction. Messages |
179 // sent through it are routed to the embedding renderer process. | 183 // sent through it are routed to the embedding renderer process. |
180 CrossProcessFrameConnector* frame_connector_; | 184 CrossProcessFrameConnector* frame_connector_; |
181 | 185 |
182 private: | |
183 base::WeakPtr<RenderWidgetHostViewChildFrame> AsWeakPtr() { | 186 base::WeakPtr<RenderWidgetHostViewChildFrame> AsWeakPtr() { |
184 return weak_factory_.GetWeakPtr(); | 187 return weak_factory_.GetWeakPtr(); |
185 } | 188 } |
186 | 189 |
| 190 private: |
187 base::WeakPtrFactory<RenderWidgetHostViewChildFrame> weak_factory_; | 191 base::WeakPtrFactory<RenderWidgetHostViewChildFrame> weak_factory_; |
188 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewChildFrame); | 192 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewChildFrame); |
189 }; | 193 }; |
190 | 194 |
191 } // namespace content | 195 } // namespace content |
192 | 196 |
193 #endif // CONTENT_BROWSER_FRAME_HOST_RENDER_WIDGET_HOST_VIEW_CHILD_FRAME_H_ | 197 #endif // CONTENT_BROWSER_FRAME_HOST_RENDER_WIDGET_HOST_VIEW_CHILD_FRAME_H_ |
OLD | NEW |