Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(149)

Side by Side Diff: content/renderer/render_view_impl.h

Issue 2417783005: [Master/Overview CL] Make PageScaleFactor work for oopif subframe.
Patch Set: Rebase to master@{#429656}. Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « content/renderer/render_frame_impl.cc ('k') | content/renderer/render_view_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 // 144 //
146 // DEPRECATED: RenderViewImpl is being removed as part of the SiteIsolation 145 // DEPRECATED: RenderViewImpl is being removed as part of the SiteIsolation
147 // project. New code should be added to RenderFrameImpl instead. 146 // project. New code should be added to RenderFrameImpl instead.
148 // 147 //
149 // For context, please see https://crbug.com/467770 and 148 // For context, please see https://crbug.com/467770 and
150 // http://www.chromium.org/developers/design-documents/site-isolation. 149 // http://www.chromium.org/developers/design-documents/site-isolation.
151 class CONTENT_EXPORT RenderViewImpl 150 class CONTENT_EXPORT RenderViewImpl
152 : public RenderWidget, 151 : public RenderWidget,
153 NON_EXPORTED_BASE(public blink::WebViewClient), 152 NON_EXPORTED_BASE(public blink::WebViewClient),
154 public RenderWidgetOwnerDelegate, 153 public RenderWidgetOwnerDelegate,
155 public RenderView, 154 public RenderView {
156 public base::SupportsWeakPtr<RenderViewImpl> {
157 public: 155 public:
158 // Creates a new RenderView. |opener_id| is the routing ID of the RenderView 156 // Creates a new RenderView. |opener_id| is the routing ID of the RenderView
159 // responsible for creating this RenderView. Note that if the original opener 157 // responsible for creating this RenderView. Note that if the original opener
160 // has been closed, |window_was_created_with_opener| will be true and 158 // has been closed, |window_was_created_with_opener| will be true and
161 // |opener_id| will be MSG_ROUTING_NONE. When |swapped_out| is true, the 159 // |opener_id| will be MSG_ROUTING_NONE. When |swapped_out| is true, the
162 // |proxy_routing_id| is specified, so a RenderFrameProxy can be created for 160 // |proxy_routing_id| is specified, so a RenderFrameProxy can be created for
163 // this RenderView's main RenderFrame. 161 // this RenderView's main RenderFrame.
164 static RenderViewImpl* Create(CompositorDependencies* compositor_deps, 162 static RenderViewImpl* Create(CompositorDependencies* compositor_deps,
165 const mojom::CreateViewParams& params, 163 const mojom::CreateViewParams& params,
166 bool was_created_by_renderer); 164 bool was_created_by_renderer);
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
235 return page_zoom_level_; 233 return page_zoom_level_;
236 } 234 }
237 235
238 // Sets page-level focus in this view and notifies plugins and Blink's 236 // Sets page-level focus in this view and notifies plugins and Blink's
239 // FocusController. 237 // FocusController.
240 void SetFocus(bool enable); 238 void SetFocus(bool enable);
241 239
242 void AttachWebFrameWidget(blink::WebFrameWidget* frame_widget); 240 void AttachWebFrameWidget(blink::WebFrameWidget* frame_widget);
243 241
244 void TransferActiveWheelFlingAnimation( 242 void TransferActiveWheelFlingAnimation(
245 const blink::WebActiveWheelFlingParameters& params); 243 const blink::WebActiveWheelFlingParameters& params) override;
246 244
247 // Starts a timer to send an UpdateState message on behalf of |frame|, if the 245 // Starts a timer to send an UpdateState message on behalf of |frame|, if the
248 // timer isn't already running. This allows multiple state changing events to 246 // timer isn't already running. This allows multiple state changing events to
249 // be coalesced into one update. 247 // be coalesced into one update.
250 void StartNavStateSyncTimerIfNecessary(RenderFrameImpl* frame); 248 void StartNavStateSyncTimerIfNecessary(RenderFrameImpl* frame);
251 249
252 // Synchronously sends the current navigation state to the browser. 250 // Synchronously sends the current navigation state to the browser.
253 void SendUpdateState(); 251 void SendUpdateState();
254 252
255 // Returns the length of the session history of this RenderView. Note that 253 // Returns the length of the session history of this RenderView. Note that
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
427 blink::WebWidget* GetWebWidget() const override; 425 blink::WebWidget* GetWebWidget() const override;
428 void CloseForFrame() override; 426 void CloseForFrame() override;
429 void Close() override; 427 void Close() override;
430 void OnResize(const ResizeParams& params) override; 428 void OnResize(const ResizeParams& params) override;
431 void OnSetFocus(bool enable) override; 429 void OnSetFocus(bool enable) override;
432 GURL GetURLForGraphicsContext3D() override; 430 GURL GetURLForGraphicsContext3D() override;
433 void OnOrientationChange() override; 431 void OnOrientationChange() override;
434 void DidCommitCompositorFrame() override; 432 void DidCommitCompositorFrame() override;
435 void DidCompletePageScaleAnimation() override; 433 void DidCompletePageScaleAnimation() override;
436 void OnDeviceScaleFactorChanged() override; 434 void OnDeviceScaleFactorChanged() override;
435 void OnSetPageScaleFactorForSubframes(double page_scale);
437 void ResizeWebWidget() override; 436 void ResizeWebWidget() override;
438 437
439 RenderViewImpl(CompositorDependencies* compositor_deps, 438 RenderViewImpl(CompositorDependencies* compositor_deps,
440 const mojom::CreateViewParams& params); 439 const mojom::CreateViewParams& params);
441 440
442 void Initialize(const mojom::CreateViewParams& params, 441 void Initialize(const mojom::CreateViewParams& params,
443 bool was_created_by_renderer); 442 bool was_created_by_renderer);
444 void SetScreenMetricsEmulationParameters( 443 void SetScreenMetricsEmulationParameters(
445 bool enabled, 444 bool enabled,
446 const blink::WebDeviceEmulationParams& params) override; 445 const blink::WebDeviceEmulationParams& params) override;
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
632 // and put it in the same position in the .cc file. 631 // and put it in the same position in the .cc file.
633 632
634 // Misc private functions ---------------------------------------------------- 633 // Misc private functions ----------------------------------------------------
635 // Check whether the preferred size has changed. 634 // Check whether the preferred size has changed.
636 void CheckPreferredSize(); 635 void CheckPreferredSize();
637 636
638 #if defined(OS_ANDROID) 637 #if defined(OS_ANDROID)
639 // Launch an Android content intent with the given URL. 638 // Launch an Android content intent with the given URL.
640 void LaunchAndroidContentIntent(const GURL& intent_url, 639 void LaunchAndroidContentIntent(const GURL& intent_url,
641 size_t request_id, 640 size_t request_id,
642 bool is_main_frame); 641 bool is_main_frame) override;
643 #endif 642 #endif
644 643
645 #if defined(OS_WIN) || (defined(OS_POSIX) && !defined(OS_MACOSX)) 644 #if defined(OS_WIN) || (defined(OS_POSIX) && !defined(OS_MACOSX))
646 void UpdateFontRenderingFromRendererPrefs(); 645 void UpdateFontRenderingFromRendererPrefs();
647 #else 646 #else
648 void UpdateFontRenderingFromRendererPrefs() {} 647 void UpdateFontRenderingFromRendererPrefs() {}
649 #endif 648 #endif
650 649
651 // In OOPIF-enabled modes, this tells each RenderFrame with a pending state 650 // In OOPIF-enabled modes, this tells each RenderFrame with a pending state
652 // update to inform the browser process. 651 // update to inform the browser process.
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after
883 // session, this info is sent to the browser along with other drag/drop info. 882 // session, this info is sent to the browser along with other drag/drop info.
884 DragEventSourceInfo possible_drag_event_info_; 883 DragEventSourceInfo possible_drag_event_info_;
885 884
886 // NOTE: stats_collection_observer_ should be the last members because their 885 // NOTE: stats_collection_observer_ should be the last members because their
887 // constructors call the AddObservers method of RenderViewImpl. 886 // constructors call the AddObservers method of RenderViewImpl.
888 std::unique_ptr<StatsCollectionObserver> stats_collection_observer_; 887 std::unique_ptr<StatsCollectionObserver> stats_collection_observer_;
889 888
890 typedef std::map<cc::SharedBitmapId, cc::SharedBitmap*> BitmapMap; 889 typedef std::map<cc::SharedBitmapId, cc::SharedBitmap*> BitmapMap;
891 BitmapMap disambiguation_bitmaps_; 890 BitmapMap disambiguation_bitmaps_;
892 891
893 bool has_added_input_handler_;
894
895 // --------------------------------------------------------------------------- 892 // ---------------------------------------------------------------------------
896 // ADDING NEW DATA? Please see if it fits appropriately in one of the above 893 // ADDING NEW DATA? Please see if it fits appropriately in one of the above
897 // sections rather than throwing it randomly at the end. If you're adding a 894 // sections rather than throwing it randomly at the end. If you're adding a
898 // bunch of stuff, you should probably create a helper class and put your 895 // bunch of stuff, you should probably create a helper class and put your
899 // data and methods on that to avoid bloating RenderView more. You can 896 // data and methods on that to avoid bloating RenderView more. You can
900 // use the Observer interface to filter IPC messages and receive frame change 897 // use the Observer interface to filter IPC messages and receive frame change
901 // notifications. 898 // notifications.
902 // --------------------------------------------------------------------------- 899 // ---------------------------------------------------------------------------
903 900
904 DISALLOW_COPY_AND_ASSIGN(RenderViewImpl); 901 DISALLOW_COPY_AND_ASSIGN(RenderViewImpl);
905 }; 902 };
906 903
907 } // namespace content 904 } // namespace content
908 905
909 #endif // CONTENT_RENDERER_RENDER_VIEW_IMPL_H_ 906 #endif // CONTENT_RENDERER_RENDER_VIEW_IMPL_H_
OLDNEW
« no previous file with comments | « content/renderer/render_frame_impl.cc ('k') | content/renderer/render_view_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698