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 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 : public RenderWidget, | 171 : public RenderWidget, |
172 NON_EXPORTED_BASE(public blink::WebViewClient), | 172 NON_EXPORTED_BASE(public blink::WebViewClient), |
173 NON_EXPORTED_BASE(public blink::WebFrameClient), | 173 NON_EXPORTED_BASE(public blink::WebFrameClient), |
174 NON_EXPORTED_BASE(public blink::WebPageSerializerClient), | 174 NON_EXPORTED_BASE(public blink::WebPageSerializerClient), |
175 public RenderView, | 175 public RenderView, |
176 NON_EXPORTED_BASE(public WebMediaPlayerDelegate), | 176 NON_EXPORTED_BASE(public WebMediaPlayerDelegate), |
177 public base::SupportsWeakPtr<RenderViewImpl> { | 177 public base::SupportsWeakPtr<RenderViewImpl> { |
178 public: | 178 public: |
179 // Creates a new RenderView. |opener_id| is the routing ID of the RenderView | 179 // Creates a new RenderView. |opener_id| is the routing ID of the RenderView |
180 // responsible for creating this RenderView. | 180 // responsible for creating this RenderView. |
181 static RenderViewImpl* Create( | 181 static RenderViewImpl* Create(int32 opener_id, |
182 int32 opener_id, | 182 const RendererPreferences& renderer_prefs, |
183 const RendererPreferences& renderer_prefs, | 183 const WebPreferences& webkit_prefs, |
184 const WebPreferences& webkit_prefs, | 184 int32 routing_id, |
185 int32 routing_id, | 185 int32 main_frame_routing_id, |
186 int32 main_frame_routing_id, | 186 int32 surface_id, |
187 int32 surface_id, | 187 int64 session_storage_namespace_id, |
188 int64 session_storage_namespace_id, | 188 const base::string16& frame_name, |
189 const base::string16& frame_name, | 189 bool is_renderer_created, |
190 bool is_renderer_created, | 190 bool swapped_out, |
191 bool swapped_out, | 191 bool hidden, |
192 bool hidden, | 192 int32 next_page_id, |
193 int32 next_page_id, | 193 const blink::WebScreenInfo& screen_info, |
194 const blink::WebScreenInfo& screen_info, | 194 unsigned int accessibility_mode); |
195 unsigned int accessibility_mode, | |
196 bool allow_partial_swap); | |
197 | 195 |
198 // Used by content_layouttest_support to hook into the creation of | 196 // Used by content_layouttest_support to hook into the creation of |
199 // RenderViewImpls. | 197 // RenderViewImpls. |
200 static void InstallCreateHook( | 198 static void InstallCreateHook( |
201 RenderViewImpl* (*create_render_view_impl)(RenderViewImplParams*)); | 199 RenderViewImpl* (*create_render_view_impl)(RenderViewImplParams*)); |
202 | 200 |
203 // Returns the RenderViewImpl containing the given WebView. | 201 // Returns the RenderViewImpl containing the given WebView. |
204 static RenderViewImpl* FromWebView(blink::WebView* webview); | 202 static RenderViewImpl* FromWebView(blink::WebView* webview); |
205 | 203 |
206 // Returns the RenderViewImpl for the given routing ID. | 204 // Returns the RenderViewImpl for the given routing ID. |
(...skipping 512 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
719 virtual void GetCompositionCharacterBounds( | 717 virtual void GetCompositionCharacterBounds( |
720 std::vector<gfx::Rect>* character_bounds) OVERRIDE; | 718 std::vector<gfx::Rect>* character_bounds) OVERRIDE; |
721 virtual void GetCompositionRange(gfx::Range* range) OVERRIDE; | 719 virtual void GetCompositionRange(gfx::Range* range) OVERRIDE; |
722 #endif | 720 #endif |
723 virtual bool CanComposeInline() OVERRIDE; | 721 virtual bool CanComposeInline() OVERRIDE; |
724 virtual void DidCommitCompositorFrame() OVERRIDE; | 722 virtual void DidCommitCompositorFrame() OVERRIDE; |
725 virtual void InstrumentWillBeginFrame(int frame_id) OVERRIDE; | 723 virtual void InstrumentWillBeginFrame(int frame_id) OVERRIDE; |
726 virtual void InstrumentDidBeginFrame() OVERRIDE; | 724 virtual void InstrumentDidBeginFrame() OVERRIDE; |
727 virtual void InstrumentDidCancelFrame() OVERRIDE; | 725 virtual void InstrumentDidCancelFrame() OVERRIDE; |
728 virtual void InstrumentWillComposite() OVERRIDE; | 726 virtual void InstrumentWillComposite() OVERRIDE; |
729 virtual bool AllowPartialSwap() const OVERRIDE; | |
730 | 727 |
731 protected: | 728 protected: |
732 explicit RenderViewImpl(RenderViewImplParams* params); | 729 explicit RenderViewImpl(RenderViewImplParams* params); |
733 | 730 |
734 void Initialize(RenderViewImplParams* params); | 731 void Initialize(RenderViewImplParams* params); |
735 virtual void SetScreenMetricsEmulationParameters( | 732 virtual void SetScreenMetricsEmulationParameters( |
736 float device_scale_factor, | 733 float device_scale_factor, |
737 const gfx::Point& root_layer_offset, | 734 const gfx::Point& root_layer_offset, |
738 float root_layer_scale) OVERRIDE; | 735 float root_layer_scale) OVERRIDE; |
739 | 736 |
(...skipping 699 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1439 bool handling_select_range_; | 1436 bool handling_select_range_; |
1440 | 1437 |
1441 // Wraps the |webwidget_| as a MouseLockDispatcher::LockTarget interface. | 1438 // Wraps the |webwidget_| as a MouseLockDispatcher::LockTarget interface. |
1442 scoped_ptr<MouseLockDispatcher::LockTarget> webwidget_mouse_lock_target_; | 1439 scoped_ptr<MouseLockDispatcher::LockTarget> webwidget_mouse_lock_target_; |
1443 | 1440 |
1444 // State associated with the GetWindowSnapshot function. | 1441 // State associated with the GetWindowSnapshot function. |
1445 int next_snapshot_id_; | 1442 int next_snapshot_id_; |
1446 typedef std::map<int, WindowSnapshotCallback> PendingSnapshotMap; | 1443 typedef std::map<int, WindowSnapshotCallback> PendingSnapshotMap; |
1447 PendingSnapshotMap pending_snapshots_; | 1444 PendingSnapshotMap pending_snapshots_; |
1448 | 1445 |
1449 // Allows to selectively disable partial buffer swap for this renderer's | |
1450 // compositor. | |
1451 bool allow_partial_swap_; | |
1452 | |
1453 // This field stores drag/drop related info for the event that is currently | 1446 // This field stores drag/drop related info for the event that is currently |
1454 // being handled. If the current event results in starting a drag/drop | 1447 // being handled. If the current event results in starting a drag/drop |
1455 // session, this info is sent to the browser along with other drag/drop info. | 1448 // session, this info is sent to the browser along with other drag/drop info. |
1456 DragEventSourceInfo possible_drag_event_info_; | 1449 DragEventSourceInfo possible_drag_event_info_; |
1457 | 1450 |
1458 // NOTE: stats_collection_observer_ should be the last members because their | 1451 // NOTE: stats_collection_observer_ should be the last members because their |
1459 // constructors call the AddObservers method of RenderViewImpl. | 1452 // constructors call the AddObservers method of RenderViewImpl. |
1460 scoped_ptr<StatsCollectionObserver> stats_collection_observer_; | 1453 scoped_ptr<StatsCollectionObserver> stats_collection_observer_; |
1461 | 1454 |
1462 // --------------------------------------------------------------------------- | 1455 // --------------------------------------------------------------------------- |
1463 // ADDING NEW DATA? Please see if it fits appropriately in one of the above | 1456 // ADDING NEW DATA? Please see if it fits appropriately in one of the above |
1464 // sections rather than throwing it randomly at the end. If you're adding a | 1457 // sections rather than throwing it randomly at the end. If you're adding a |
1465 // bunch of stuff, you should probably create a helper class and put your | 1458 // bunch of stuff, you should probably create a helper class and put your |
1466 // data and methods on that to avoid bloating RenderView more. You can | 1459 // data and methods on that to avoid bloating RenderView more. You can |
1467 // use the Observer interface to filter IPC messages and receive frame change | 1460 // use the Observer interface to filter IPC messages and receive frame change |
1468 // notifications. | 1461 // notifications. |
1469 // --------------------------------------------------------------------------- | 1462 // --------------------------------------------------------------------------- |
1470 | 1463 |
1471 DISALLOW_COPY_AND_ASSIGN(RenderViewImpl); | 1464 DISALLOW_COPY_AND_ASSIGN(RenderViewImpl); |
1472 }; | 1465 }; |
1473 | 1466 |
1474 } // namespace content | 1467 } // namespace content |
1475 | 1468 |
1476 #endif // CONTENT_RENDERER_RENDER_VIEW_IMPL_H_ | 1469 #endif // CONTENT_RENDERER_RENDER_VIEW_IMPL_H_ |
OLD | NEW |