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_RENDERER_RENDER_VIEW_IMPL_H_ | 5 #ifndef CONTENT_RENDERER_RENDER_VIEW_IMPL_H_ |
6 #define CONTENT_RENDERER_RENDER_VIEW_IMPL_H_ | 6 #define CONTENT_RENDERER_RENDER_VIEW_IMPL_H_ |
7 | 7 |
8 #include <deque> | 8 #include <deque> |
9 #include <map> | 9 #include <map> |
10 #include <set> | 10 #include <set> |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
70 // RenderViewImpl is a diamond-shaped hierarchy, with WebWidgetClient at the | 70 // RenderViewImpl is a diamond-shaped hierarchy, with WebWidgetClient at the |
71 // root. VS warns when we inherit the WebWidgetClient method implementations | 71 // root. VS warns when we inherit the WebWidgetClient method implementations |
72 // from RenderWidget. It's safe to ignore that warning. | 72 // from RenderWidget. It's safe to ignore that warning. |
73 #pragma warning(disable: 4250) | 73 #pragma warning(disable: 4250) |
74 #endif | 74 #endif |
75 | 75 |
76 class PepperDeviceTest; | 76 class PepperDeviceTest; |
77 class SkBitmap; | 77 class SkBitmap; |
78 struct PP_NetAddress_Private; | 78 struct PP_NetAddress_Private; |
79 struct FrameMsg_Navigate_Params; | 79 struct FrameMsg_Navigate_Params; |
80 struct ViewMsg_New_Params; | |
80 struct ViewMsg_PostMessage_Params; | 81 struct ViewMsg_PostMessage_Params; |
81 struct ViewMsg_Resize_Params; | 82 struct ViewMsg_Resize_Params; |
82 struct ViewMsg_StopFinding_Params; | 83 struct ViewMsg_StopFinding_Params; |
83 | 84 |
84 namespace base { | 85 namespace base { |
85 class CommandLine; | 86 class CommandLine; |
86 } | 87 } |
87 | 88 |
88 namespace blink { | 89 namespace blink { |
89 class WebApplicationCacheHost; | 90 class WebApplicationCacheHost; |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
157 NON_EXPORTED_BASE(public blink::WebPageSerializerClient), | 158 NON_EXPORTED_BASE(public blink::WebPageSerializerClient), |
158 public RenderView, | 159 public RenderView, |
159 public base::SupportsWeakPtr<RenderViewImpl> { | 160 public base::SupportsWeakPtr<RenderViewImpl> { |
160 public: | 161 public: |
161 // Creates a new RenderView. |opener_id| is the routing ID of the RenderView | 162 // Creates a new RenderView. |opener_id| is the routing ID of the RenderView |
162 // responsible for creating this RenderView. Note that if the original opener | 163 // responsible for creating this RenderView. Note that if the original opener |
163 // has been closed, |window_was_created_with_opener| will be true and | 164 // has been closed, |window_was_created_with_opener| will be true and |
164 // |opener_id| will be MSG_ROUTING_NONE. When |swapped_out| is true, the | 165 // |opener_id| will be MSG_ROUTING_NONE. When |swapped_out| is true, the |
165 // |proxy_routing_id| is specified, so a RenderFrameProxy can be created for | 166 // |proxy_routing_id| is specified, so a RenderFrameProxy can be created for |
166 // this RenderView's main RenderFrame. | 167 // this RenderView's main RenderFrame. |
167 static RenderViewImpl* Create(int32 opener_id, | 168 static RenderViewImpl* Create(bool is_renderer_created, |
168 bool window_was_created_with_opener, | 169 const ViewMsg_New_Params& params); |
Charlie Reis
2014/11/24 23:28:21
I kind of wish we could do this without taking an
nasko
2014/11/24 23:47:55
Thanks for looking into this! FYI, I've applied th
| |
169 const RendererPreferences& renderer_prefs, | |
170 const WebPreferences& webkit_prefs, | |
171 int32 routing_id, | |
172 int32 main_frame_routing_id, | |
173 int32 surface_id, | |
174 int64 session_storage_namespace_id, | |
175 const base::string16& frame_name, | |
176 bool is_renderer_created, | |
177 bool swapped_out, | |
178 int32 proxy_routing_id, | |
179 bool hidden, | |
180 bool never_visible, | |
181 int32 next_page_id, | |
182 const ViewMsg_Resize_Params& initial_size, | |
183 bool enable_auto_resize, | |
184 const gfx::Size& min_size, | |
185 const gfx::Size& max_size); | |
186 | 170 |
187 // Used by content_layouttest_support to hook into the creation of | 171 // Used by content_layouttest_support to hook into the creation of |
188 // RenderViewImpls. | 172 // RenderViewImpls. |
189 static void InstallCreateHook( | 173 static void InstallCreateHook( |
190 RenderViewImpl* (*create_render_view_impl)(RenderViewImplParams*)); | 174 RenderViewImpl* (*create_render_view_impl)(const ViewMsg_New_Params&)); |
191 | 175 |
192 // Returns the RenderViewImpl containing the given WebView. | 176 // Returns the RenderViewImpl containing the given WebView. |
193 static RenderViewImpl* FromWebView(blink::WebView* webview); | 177 static RenderViewImpl* FromWebView(blink::WebView* webview); |
194 | 178 |
195 // Returns the RenderViewImpl for the given routing ID. | 179 // Returns the RenderViewImpl for the given routing ID. |
196 static RenderViewImpl* FromRoutingID(int routing_id); | 180 static RenderViewImpl* FromRoutingID(int routing_id); |
197 | 181 |
198 static size_t GetRenderViewCount(); | 182 static size_t GetRenderViewCount(); |
199 | 183 |
200 // May return NULL when the view is closing. | 184 // May return NULL when the view is closing. |
(...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
532 void GetCompositionRange(gfx::Range* range) override; | 516 void GetCompositionRange(gfx::Range* range) override; |
533 #endif | 517 #endif |
534 bool CanComposeInline() override; | 518 bool CanComposeInline() override; |
535 void DidCommitCompositorFrame() override; | 519 void DidCommitCompositorFrame() override; |
536 void InstrumentWillBeginFrame(int frame_id) override; | 520 void InstrumentWillBeginFrame(int frame_id) override; |
537 void InstrumentDidBeginFrame() override; | 521 void InstrumentDidBeginFrame() override; |
538 void InstrumentDidCancelFrame() override; | 522 void InstrumentDidCancelFrame() override; |
539 void InstrumentWillComposite() override; | 523 void InstrumentWillComposite() override; |
540 | 524 |
541 protected: | 525 protected: |
542 explicit RenderViewImpl(RenderViewImplParams* params); | 526 explicit RenderViewImpl(const ViewMsg_New_Params& params); |
543 | 527 |
544 void Initialize(RenderViewImplParams* params); | 528 void Initialize(bool is_renderer_created, const ViewMsg_New_Params& params); |
Charlie Reis
2014/11/24 23:28:21
nit: is_renderer_created isn't a great name, since
nasko
2014/11/24 23:47:55
Done.
| |
545 void SetScreenMetricsEmulationParameters(float device_scale_factor, | 529 void SetScreenMetricsEmulationParameters(float device_scale_factor, |
546 const gfx::Point& root_layer_offset, | 530 const gfx::Point& root_layer_offset, |
547 float root_layer_scale) override; | 531 float root_layer_scale) override; |
548 | 532 |
549 // Do not delete directly. This class is reference counted. | 533 // Do not delete directly. This class is reference counted. |
550 virtual ~RenderViewImpl(); | 534 virtual ~RenderViewImpl(); |
551 | 535 |
552 private: | 536 private: |
553 // For unit tests. | 537 // For unit tests. |
554 friend class PepperDeviceTest; | 538 friend class PepperDeviceTest; |
(...skipping 549 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1104 // use the Observer interface to filter IPC messages and receive frame change | 1088 // use the Observer interface to filter IPC messages and receive frame change |
1105 // notifications. | 1089 // notifications. |
1106 // --------------------------------------------------------------------------- | 1090 // --------------------------------------------------------------------------- |
1107 | 1091 |
1108 DISALLOW_COPY_AND_ASSIGN(RenderViewImpl); | 1092 DISALLOW_COPY_AND_ASSIGN(RenderViewImpl); |
1109 }; | 1093 }; |
1110 | 1094 |
1111 } // namespace content | 1095 } // namespace content |
1112 | 1096 |
1113 #endif // CONTENT_RENDERER_RENDER_VIEW_IMPL_H_ | 1097 #endif // CONTENT_RENDERER_RENDER_VIEW_IMPL_H_ |
OLD | NEW |