| 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(const ViewMsg_New_Params& params, |
| 168 bool window_was_created_with_opener, | 169 bool was_created_by_renderer); |
| 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(const ViewMsg_New_Params& params, |
| 529 bool was_created_by_renderer); |
| 545 void SetScreenMetricsEmulationParameters(float device_scale_factor, | 530 void SetScreenMetricsEmulationParameters(float device_scale_factor, |
| 546 const gfx::Point& root_layer_offset, | 531 const gfx::Point& root_layer_offset, |
| 547 float root_layer_scale) override; | 532 float root_layer_scale) override; |
| 548 | 533 |
| 549 // Do not delete directly. This class is reference counted. | 534 // Do not delete directly. This class is reference counted. |
| 550 virtual ~RenderViewImpl(); | 535 virtual ~RenderViewImpl(); |
| 551 | 536 |
| 552 private: | 537 private: |
| 553 // For unit tests. | 538 // For unit tests. |
| 554 friend class PepperDeviceTest; | 539 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 | 1089 // use the Observer interface to filter IPC messages and receive frame change |
| 1105 // notifications. | 1090 // notifications. |
| 1106 // --------------------------------------------------------------------------- | 1091 // --------------------------------------------------------------------------- |
| 1107 | 1092 |
| 1108 DISALLOW_COPY_AND_ASSIGN(RenderViewImpl); | 1093 DISALLOW_COPY_AND_ASSIGN(RenderViewImpl); |
| 1109 }; | 1094 }; |
| 1110 | 1095 |
| 1111 } // namespace content | 1096 } // namespace content |
| 1112 | 1097 |
| 1113 #endif // CONTENT_RENDERER_RENDER_VIEW_IMPL_H_ | 1098 #endif // CONTENT_RENDERER_RENDER_VIEW_IMPL_H_ |
| OLD | NEW |