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/surfaces/surface_factory_client.h" |
| 10 #include "cc/surfaces/surface_id_allocator.h" |
| 11 #include "content/browser/compositor/image_transport_factory.h" |
9 #include "content/browser/renderer_host/render_widget_host_view_base.h" | 12 #include "content/browser/renderer_host/render_widget_host_view_base.h" |
10 #include "content/common/content_export.h" | 13 #include "content/common/content_export.h" |
11 #include "content/public/browser/readback_types.h" | 14 #include "content/public/browser/readback_types.h" |
| 15 #include "ui/compositor/compositor.h" |
12 #include "ui/gfx/geometry/rect.h" | 16 #include "ui/gfx/geometry/rect.h" |
13 #include "ui/gfx/native_widget_types.h" | 17 #include "ui/gfx/native_widget_types.h" |
14 | 18 |
| 19 namespace cc { |
| 20 class SurfaceFactory; |
| 21 enum class SurfaceDrawStatus; |
| 22 } |
| 23 |
15 namespace content { | 24 namespace content { |
16 class CrossProcessFrameConnector; | 25 class CrossProcessFrameConnector; |
17 class RenderWidgetHost; | 26 class RenderWidgetHost; |
18 class RenderWidgetHostImpl; | 27 class RenderWidgetHostImpl; |
| 28 class RenderWidgetHostViewChildFrameTest; |
19 | 29 |
20 // RenderWidgetHostViewChildFrame implements the view for a RenderWidgetHost | 30 // RenderWidgetHostViewChildFrame implements the view for a RenderWidgetHost |
21 // associated with content being rendered in a separate process from | 31 // associated with content being rendered in a separate process from |
22 // content that is embedding it. This is not a platform-specific class; rather, | 32 // content that is embedding it. This is not a platform-specific class; rather, |
23 // the embedding renderer process implements the platform containing the | 33 // the embedding renderer process implements the platform containing the |
24 // widget, and the top-level frame's RenderWidgetHostView will ultimately | 34 // widget, and the top-level frame's RenderWidgetHostView will ultimately |
25 // manage all native widget interaction. | 35 // manage all native widget interaction. |
26 // | 36 // |
27 // See comments in render_widget_host_view.h about this class and its members. | 37 // See comments in render_widget_host_view.h about this class and its members. |
28 class CONTENT_EXPORT RenderWidgetHostViewChildFrame | 38 class CONTENT_EXPORT RenderWidgetHostViewChildFrame |
29 : public RenderWidgetHostViewBase { | 39 : public RenderWidgetHostViewBase, |
| 40 public cc::SurfaceFactoryClient, |
| 41 public base::SupportsWeakPtr<RenderWidgetHostViewChildFrame> { |
30 public: | 42 public: |
31 explicit RenderWidgetHostViewChildFrame(RenderWidgetHost* widget); | 43 explicit RenderWidgetHostViewChildFrame(RenderWidgetHost* widget); |
32 ~RenderWidgetHostViewChildFrame() override; | 44 ~RenderWidgetHostViewChildFrame() override; |
33 | 45 |
34 void set_cross_process_frame_connector( | 46 void set_cross_process_frame_connector( |
35 CrossProcessFrameConnector* frame_connector) { | 47 CrossProcessFrameConnector* frame_connector) { |
36 frame_connector_ = frame_connector; | 48 frame_connector_ = frame_connector; |
37 } | 49 } |
38 | 50 |
39 // RenderWidgetHostView implementation. | 51 // RenderWidgetHostView implementation. |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 #if defined(OS_WIN) | 139 #if defined(OS_WIN) |
128 void SetParentNativeViewAccessible( | 140 void SetParentNativeViewAccessible( |
129 gfx::NativeViewAccessible accessible_parent) override; | 141 gfx::NativeViewAccessible accessible_parent) override; |
130 gfx::NativeViewId GetParentForWindowlessPlugin() const override; | 142 gfx::NativeViewId GetParentForWindowlessPlugin() const override; |
131 #endif | 143 #endif |
132 BrowserAccessibilityManager* CreateBrowserAccessibilityManager( | 144 BrowserAccessibilityManager* CreateBrowserAccessibilityManager( |
133 BrowserAccessibilityDelegate* delegate) override; | 145 BrowserAccessibilityDelegate* delegate) override; |
134 | 146 |
135 SkColorType PreferredReadbackFormat() override; | 147 SkColorType PreferredReadbackFormat() override; |
136 | 148 |
| 149 // cc::SurfaceFactoryClient implementation. |
| 150 void ReturnResources(const cc::ReturnedResourceArray& resources) override; |
| 151 |
137 protected: | 152 protected: |
138 friend class RenderWidgetHostView; | 153 friend class RenderWidgetHostView; |
| 154 friend class RenderWidgetHostViewChildFrameTest; |
| 155 |
| 156 void SurfaceDrawn(uint32 output_surface_id, cc::SurfaceDrawStatus drawn); |
139 | 157 |
140 // The last scroll offset of the view. | 158 // The last scroll offset of the view. |
141 gfx::Vector2dF last_scroll_offset_; | 159 gfx::Vector2dF last_scroll_offset_; |
142 | 160 |
143 // Members will become private when RenderWidgetHostViewGuest is removed. | 161 // Members will become private when RenderWidgetHostViewGuest is removed. |
144 // The model object. | 162 // The model object. |
145 RenderWidgetHostImpl* host_; | 163 RenderWidgetHostImpl* host_; |
146 | 164 |
| 165 // Flag determining whether we render into a compositing surface. |
| 166 bool use_surfaces_; |
| 167 |
| 168 // Surface-related state. |
| 169 scoped_ptr<cc::SurfaceIdAllocator> id_allocator_; |
| 170 scoped_ptr<cc::SurfaceFactory> surface_factory_; |
| 171 cc::SurfaceId surface_id_; |
| 172 uint32 next_surface_sequence_; |
| 173 uint32 last_output_surface_id_; |
| 174 gfx::Size current_surface_size_; |
| 175 float current_surface_scale_factor_; |
| 176 |
147 // frame_connector_ provides a platform abstraction. Messages | 177 // frame_connector_ provides a platform abstraction. Messages |
148 // sent through it are routed to the embedding renderer process. | 178 // sent through it are routed to the embedding renderer process. |
149 CrossProcessFrameConnector* frame_connector_; | 179 CrossProcessFrameConnector* frame_connector_; |
150 | 180 |
151 private: | 181 private: |
152 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewChildFrame); | 182 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewChildFrame); |
153 }; | 183 }; |
154 | 184 |
155 } // namespace content | 185 } // namespace content |
156 | 186 |
157 #endif // CONTENT_BROWSER_FRAME_HOST_RENDER_WIDGET_HOST_VIEW_CHILD_FRAME_H_ | 187 #endif // CONTENT_BROWSER_FRAME_HOST_RENDER_WIDGET_HOST_VIEW_CHILD_FRAME_H_ |
OLD | NEW |