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 <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
11 #include <deque> | 11 #include <deque> |
12 #include <map> | 12 #include <map> |
13 #include <memory> | 13 #include <memory> |
14 #include <set> | 14 #include <set> |
15 #include <string> | 15 #include <string> |
16 #include <vector> | 16 #include <vector> |
17 | 17 |
18 #include "base/gtest_prod_util.h" | 18 #include "base/gtest_prod_util.h" |
19 #include "base/id_map.h" | 19 #include "base/id_map.h" |
20 #include "base/macros.h" | 20 #include "base/macros.h" |
21 #include "base/memory/weak_ptr.h" | |
22 #include "base/observer_list.h" | 21 #include "base/observer_list.h" |
23 #include "base/process/process.h" | 22 #include "base/process/process.h" |
24 #include "base/strings/string16.h" | 23 #include "base/strings/string16.h" |
25 #include "base/timer/timer.h" | 24 #include "base/timer/timer.h" |
26 #include "build/build_config.h" | 25 #include "build/build_config.h" |
27 #include "cc/input/browser_controls_state.h" | 26 #include "cc/input/browser_controls_state.h" |
28 #include "cc/resources/shared_bitmap.h" | 27 #include "cc/resources/shared_bitmap.h" |
29 #include "content/common/content_export.h" | 28 #include "content/common/content_export.h" |
30 #include "content/common/frame_message_enums.h" | 29 #include "content/common/frame_message_enums.h" |
31 #include "content/common/navigation_gesture.h" | 30 #include "content/common/navigation_gesture.h" |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 // | 116 // |
118 // DEPRECATED: RenderViewImpl is being removed as part of the SiteIsolation | 117 // DEPRECATED: RenderViewImpl is being removed as part of the SiteIsolation |
119 // project. New code should be added to RenderFrameImpl instead. | 118 // project. New code should be added to RenderFrameImpl instead. |
120 // | 119 // |
121 // For context, please see https://crbug.com/467770 and | 120 // For context, please see https://crbug.com/467770 and |
122 // http://www.chromium.org/developers/design-documents/site-isolation. | 121 // http://www.chromium.org/developers/design-documents/site-isolation. |
123 class CONTENT_EXPORT RenderViewImpl | 122 class CONTENT_EXPORT RenderViewImpl |
124 : public RenderWidget, | 123 : public RenderWidget, |
125 NON_EXPORTED_BASE(public blink::WebViewClient), | 124 NON_EXPORTED_BASE(public blink::WebViewClient), |
126 public RenderWidgetOwnerDelegate, | 125 public RenderWidgetOwnerDelegate, |
127 public RenderView, | 126 public RenderView { |
128 public base::SupportsWeakPtr<RenderViewImpl> { | |
129 public: | 127 public: |
130 // Creates a new RenderView. |opener_id| is the routing ID of the RenderView | 128 // Creates a new RenderView. |opener_id| is the routing ID of the RenderView |
131 // responsible for creating this RenderView. Note that if the original opener | 129 // responsible for creating this RenderView. Note that if the original opener |
132 // has been closed, |window_was_created_with_opener| will be true and | 130 // has been closed, |window_was_created_with_opener| will be true and |
133 // |opener_id| will be MSG_ROUTING_NONE. When |swapped_out| is true, the | 131 // |opener_id| will be MSG_ROUTING_NONE. When |swapped_out| is true, the |
134 // |proxy_routing_id| is specified, so a RenderFrameProxy can be created for | 132 // |proxy_routing_id| is specified, so a RenderFrameProxy can be created for |
135 // this RenderView's main RenderFrame. | 133 // this RenderView's main RenderFrame. |
136 static RenderViewImpl* Create(CompositorDependencies* compositor_deps, | 134 static RenderViewImpl* Create(CompositorDependencies* compositor_deps, |
137 const mojom::CreateViewParams& params, | 135 const mojom::CreateViewParams& params, |
138 bool was_created_by_renderer); | 136 bool was_created_by_renderer); |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
207 return page_zoom_level_; | 205 return page_zoom_level_; |
208 } | 206 } |
209 | 207 |
210 // Sets page-level focus in this view and notifies plugins and Blink's | 208 // Sets page-level focus in this view and notifies plugins and Blink's |
211 // FocusController. | 209 // FocusController. |
212 void SetFocus(bool enable); | 210 void SetFocus(bool enable); |
213 | 211 |
214 void AttachWebFrameWidget(blink::WebFrameWidget* frame_widget); | 212 void AttachWebFrameWidget(blink::WebFrameWidget* frame_widget); |
215 | 213 |
216 void TransferActiveWheelFlingAnimation( | 214 void TransferActiveWheelFlingAnimation( |
217 const blink::WebActiveWheelFlingParameters& params); | 215 const blink::WebActiveWheelFlingParameters& params) override; |
218 | 216 |
219 // Starts a timer to send an UpdateState message on behalf of |frame|, if the | 217 // Starts a timer to send an UpdateState message on behalf of |frame|, if the |
220 // timer isn't already running. This allows multiple state changing events to | 218 // timer isn't already running. This allows multiple state changing events to |
221 // be coalesced into one update. | 219 // be coalesced into one update. |
222 void StartNavStateSyncTimerIfNecessary(RenderFrameImpl* frame); | 220 void StartNavStateSyncTimerIfNecessary(RenderFrameImpl* frame); |
223 | 221 |
224 // Synchronously sends the current navigation state to the browser. | 222 // Synchronously sends the current navigation state to the browser. |
225 void SendUpdateState(); | 223 void SendUpdateState(); |
226 | 224 |
227 // Returns the length of the session history of this RenderView. Note that | 225 // Returns the length of the session history of this RenderView. Note that |
(...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
598 // and put it in the same position in the .cc file. | 596 // and put it in the same position in the .cc file. |
599 | 597 |
600 // Misc private functions ---------------------------------------------------- | 598 // Misc private functions ---------------------------------------------------- |
601 // Check whether the preferred size has changed. | 599 // Check whether the preferred size has changed. |
602 void CheckPreferredSize(); | 600 void CheckPreferredSize(); |
603 | 601 |
604 #if defined(OS_ANDROID) | 602 #if defined(OS_ANDROID) |
605 // Launch an Android content intent with the given URL. | 603 // Launch an Android content intent with the given URL. |
606 void LaunchAndroidContentIntent(const GURL& intent_url, | 604 void LaunchAndroidContentIntent(const GURL& intent_url, |
607 size_t request_id, | 605 size_t request_id, |
608 bool is_main_frame); | 606 bool is_main_frame) override; |
609 #endif | 607 #endif |
610 | 608 |
611 #if defined(OS_WIN) || (defined(OS_POSIX) && !defined(OS_MACOSX)) | 609 #if defined(OS_WIN) || (defined(OS_POSIX) && !defined(OS_MACOSX)) |
612 void UpdateFontRenderingFromRendererPrefs(); | 610 void UpdateFontRenderingFromRendererPrefs(); |
613 #else | 611 #else |
614 void UpdateFontRenderingFromRendererPrefs() {} | 612 void UpdateFontRenderingFromRendererPrefs() {} |
615 #endif | 613 #endif |
616 | 614 |
617 // In OOPIF-enabled modes, this tells each RenderFrame with a pending state | 615 // In OOPIF-enabled modes, this tells each RenderFrame with a pending state |
618 // update to inform the browser process. | 616 // update to inform the browser process. |
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
844 // is fine. | 842 // is fine. |
845 base::ObserverList<RenderViewObserver> observers_; | 843 base::ObserverList<RenderViewObserver> observers_; |
846 | 844 |
847 // NOTE: stats_collection_observer_ should be the last members because their | 845 // NOTE: stats_collection_observer_ should be the last members because their |
848 // constructors call the AddObservers method of RenderViewImpl. | 846 // constructors call the AddObservers method of RenderViewImpl. |
849 std::unique_ptr<StatsCollectionObserver> stats_collection_observer_; | 847 std::unique_ptr<StatsCollectionObserver> stats_collection_observer_; |
850 | 848 |
851 typedef std::map<cc::SharedBitmapId, cc::SharedBitmap*> BitmapMap; | 849 typedef std::map<cc::SharedBitmapId, cc::SharedBitmap*> BitmapMap; |
852 BitmapMap disambiguation_bitmaps_; | 850 BitmapMap disambiguation_bitmaps_; |
853 | 851 |
854 bool has_added_input_handler_; | |
855 | |
856 // --------------------------------------------------------------------------- | 852 // --------------------------------------------------------------------------- |
857 // ADDING NEW DATA? Please see if it fits appropriately in one of the above | 853 // ADDING NEW DATA? Please see if it fits appropriately in one of the above |
858 // sections rather than throwing it randomly at the end. If you're adding a | 854 // sections rather than throwing it randomly at the end. If you're adding a |
859 // bunch of stuff, you should probably create a helper class and put your | 855 // bunch of stuff, you should probably create a helper class and put your |
860 // data and methods on that to avoid bloating RenderView more. You can | 856 // data and methods on that to avoid bloating RenderView more. You can |
861 // use the Observer interface to filter IPC messages and receive frame change | 857 // use the Observer interface to filter IPC messages and receive frame change |
862 // notifications. | 858 // notifications. |
863 // --------------------------------------------------------------------------- | 859 // --------------------------------------------------------------------------- |
864 | 860 |
865 DISALLOW_COPY_AND_ASSIGN(RenderViewImpl); | 861 DISALLOW_COPY_AND_ASSIGN(RenderViewImpl); |
866 }; | 862 }; |
867 | 863 |
868 } // namespace content | 864 } // namespace content |
869 | 865 |
870 #endif // CONTENT_RENDERER_RENDER_VIEW_IMPL_H_ | 866 #endif // CONTENT_RENDERER_RENDER_VIEW_IMPL_H_ |
OLD | NEW |