| 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/drag_event_source_info.h" | 29 #include "content/common/drag_event_source_info.h" |
| 31 #include "content/common/frame_message_enums.h" | 30 #include "content/common/frame_message_enums.h" |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 // | 118 // |
| 120 // DEPRECATED: RenderViewImpl is being removed as part of the SiteIsolation | 119 // DEPRECATED: RenderViewImpl is being removed as part of the SiteIsolation |
| 121 // project. New code should be added to RenderFrameImpl instead. | 120 // project. New code should be added to RenderFrameImpl instead. |
| 122 // | 121 // |
| 123 // For context, please see https://crbug.com/467770 and | 122 // For context, please see https://crbug.com/467770 and |
| 124 // http://www.chromium.org/developers/design-documents/site-isolation. | 123 // http://www.chromium.org/developers/design-documents/site-isolation. |
| 125 class CONTENT_EXPORT RenderViewImpl | 124 class CONTENT_EXPORT RenderViewImpl |
| 126 : public RenderWidget, | 125 : public RenderWidget, |
| 127 NON_EXPORTED_BASE(public blink::WebViewClient), | 126 NON_EXPORTED_BASE(public blink::WebViewClient), |
| 128 public RenderWidgetOwnerDelegate, | 127 public RenderWidgetOwnerDelegate, |
| 129 public RenderView, | 128 public RenderView { |
| 130 public base::SupportsWeakPtr<RenderViewImpl> { | |
| 131 public: | 129 public: |
| 132 // Creates a new RenderView. |opener_id| is the routing ID of the RenderView | 130 // Creates a new RenderView. |opener_id| is the routing ID of the RenderView |
| 133 // responsible for creating this RenderView. Note that if the original opener | 131 // responsible for creating this RenderView. Note that if the original opener |
| 134 // has been closed, |window_was_created_with_opener| will be true and | 132 // has been closed, |window_was_created_with_opener| will be true and |
| 135 // |opener_id| will be MSG_ROUTING_NONE. When |swapped_out| is true, the | 133 // |opener_id| will be MSG_ROUTING_NONE. When |swapped_out| is true, the |
| 136 // |proxy_routing_id| is specified, so a RenderFrameProxy can be created for | 134 // |proxy_routing_id| is specified, so a RenderFrameProxy can be created for |
| 137 // this RenderView's main RenderFrame. | 135 // this RenderView's main RenderFrame. |
| 138 static RenderViewImpl* Create(CompositorDependencies* compositor_deps, | 136 static RenderViewImpl* Create(CompositorDependencies* compositor_deps, |
| 139 const mojom::CreateViewParams& params, | 137 const mojom::CreateViewParams& params, |
| 140 bool was_created_by_renderer); | 138 bool was_created_by_renderer); |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 209 return page_zoom_level_; | 207 return page_zoom_level_; |
| 210 } | 208 } |
| 211 | 209 |
| 212 // Sets page-level focus in this view and notifies plugins and Blink's | 210 // Sets page-level focus in this view and notifies plugins and Blink's |
| 213 // FocusController. | 211 // FocusController. |
| 214 void SetFocus(bool enable); | 212 void SetFocus(bool enable); |
| 215 | 213 |
| 216 void AttachWebFrameWidget(blink::WebFrameWidget* frame_widget); | 214 void AttachWebFrameWidget(blink::WebFrameWidget* frame_widget); |
| 217 | 215 |
| 218 void TransferActiveWheelFlingAnimation( | 216 void TransferActiveWheelFlingAnimation( |
| 219 const blink::WebActiveWheelFlingParameters& params); | 217 const blink::WebActiveWheelFlingParameters& params) override; |
| 220 | 218 |
| 221 // Starts a timer to send an UpdateState message on behalf of |frame|, if the | 219 // Starts a timer to send an UpdateState message on behalf of |frame|, if the |
| 222 // timer isn't already running. This allows multiple state changing events to | 220 // timer isn't already running. This allows multiple state changing events to |
| 223 // be coalesced into one update. | 221 // be coalesced into one update. |
| 224 void StartNavStateSyncTimerIfNecessary(RenderFrameImpl* frame); | 222 void StartNavStateSyncTimerIfNecessary(RenderFrameImpl* frame); |
| 225 | 223 |
| 226 // Synchronously sends the current navigation state to the browser. | 224 // Synchronously sends the current navigation state to the browser. |
| 227 void SendUpdateState(); | 225 void SendUpdateState(); |
| 228 | 226 |
| 229 // Returns the length of the session history of this RenderView. Note that | 227 // Returns the length of the session history of this RenderView. Note that |
| (...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 607 // and put it in the same position in the .cc file. | 605 // and put it in the same position in the .cc file. |
| 608 | 606 |
| 609 // Misc private functions ---------------------------------------------------- | 607 // Misc private functions ---------------------------------------------------- |
| 610 // Check whether the preferred size has changed. | 608 // Check whether the preferred size has changed. |
| 611 void CheckPreferredSize(); | 609 void CheckPreferredSize(); |
| 612 | 610 |
| 613 #if defined(OS_ANDROID) | 611 #if defined(OS_ANDROID) |
| 614 // Launch an Android content intent with the given URL. | 612 // Launch an Android content intent with the given URL. |
| 615 void LaunchAndroidContentIntent(const GURL& intent_url, | 613 void LaunchAndroidContentIntent(const GURL& intent_url, |
| 616 size_t request_id, | 614 size_t request_id, |
| 617 bool is_main_frame); | 615 bool is_main_frame) override; |
| 618 #endif | 616 #endif |
| 619 | 617 |
| 620 #if defined(OS_WIN) || (defined(OS_POSIX) && !defined(OS_MACOSX)) | 618 #if defined(OS_WIN) || (defined(OS_POSIX) && !defined(OS_MACOSX)) |
| 621 void UpdateFontRenderingFromRendererPrefs(); | 619 void UpdateFontRenderingFromRendererPrefs(); |
| 622 #else | 620 #else |
| 623 void UpdateFontRenderingFromRendererPrefs() {} | 621 void UpdateFontRenderingFromRendererPrefs() {} |
| 624 #endif | 622 #endif |
| 625 | 623 |
| 626 // In OOPIF-enabled modes, this tells each RenderFrame with a pending state | 624 // In OOPIF-enabled modes, this tells each RenderFrame with a pending state |
| 627 // update to inform the browser process. | 625 // update to inform the browser process. |
| (...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 858 // session, this info is sent to the browser along with other drag/drop info. | 856 // session, this info is sent to the browser along with other drag/drop info. |
| 859 DragEventSourceInfo possible_drag_event_info_; | 857 DragEventSourceInfo possible_drag_event_info_; |
| 860 | 858 |
| 861 // NOTE: stats_collection_observer_ should be the last members because their | 859 // NOTE: stats_collection_observer_ should be the last members because their |
| 862 // constructors call the AddObservers method of RenderViewImpl. | 860 // constructors call the AddObservers method of RenderViewImpl. |
| 863 std::unique_ptr<StatsCollectionObserver> stats_collection_observer_; | 861 std::unique_ptr<StatsCollectionObserver> stats_collection_observer_; |
| 864 | 862 |
| 865 typedef std::map<cc::SharedBitmapId, cc::SharedBitmap*> BitmapMap; | 863 typedef std::map<cc::SharedBitmapId, cc::SharedBitmap*> BitmapMap; |
| 866 BitmapMap disambiguation_bitmaps_; | 864 BitmapMap disambiguation_bitmaps_; |
| 867 | 865 |
| 868 bool has_added_input_handler_; | |
| 869 | |
| 870 // --------------------------------------------------------------------------- | 866 // --------------------------------------------------------------------------- |
| 871 // ADDING NEW DATA? Please see if it fits appropriately in one of the above | 867 // ADDING NEW DATA? Please see if it fits appropriately in one of the above |
| 872 // sections rather than throwing it randomly at the end. If you're adding a | 868 // sections rather than throwing it randomly at the end. If you're adding a |
| 873 // bunch of stuff, you should probably create a helper class and put your | 869 // bunch of stuff, you should probably create a helper class and put your |
| 874 // data and methods on that to avoid bloating RenderView more. You can | 870 // data and methods on that to avoid bloating RenderView more. You can |
| 875 // use the Observer interface to filter IPC messages and receive frame change | 871 // use the Observer interface to filter IPC messages and receive frame change |
| 876 // notifications. | 872 // notifications. |
| 877 // --------------------------------------------------------------------------- | 873 // --------------------------------------------------------------------------- |
| 878 | 874 |
| 879 DISALLOW_COPY_AND_ASSIGN(RenderViewImpl); | 875 DISALLOW_COPY_AND_ASSIGN(RenderViewImpl); |
| 880 }; | 876 }; |
| 881 | 877 |
| 882 } // namespace content | 878 } // namespace content |
| 883 | 879 |
| 884 #endif // CONTENT_RENDERER_RENDER_VIEW_IMPL_H_ | 880 #endif // CONTENT_RENDERER_RENDER_VIEW_IMPL_H_ |
| OLD | NEW |