Move PageScaleFactor setters from WebLayerTreeView to WebWidgetClient (6/n)
The SetPageScaleFactorAndLimits() and StartPageScaleAnimation() methods
both move to WebWidgetClient, though are only called for the main frame
widget, when compositing is being used.
The HasPendingPageScaleAnimation() can move directly to RenderWidget
since it is only used inside of content.
The WebLayerTreeView is a shortcut past the WebWidgetClient that is
not needed now that we always composite. This works toward eliminating
this extra API layer.
More importantly this helps us Close/Restart the WebWidget parts of
WebViewImpl by not requiring plumbing 2 pointers with slightly different
lifetimes (WebLayerTreeView is created inside the Init of the
WebWidgetClient). This will help avoid a bunch of complexity in
creating WebFrameWidgets and other WebWidgets.
Also add a bunch of DCHECKs around expectations that page scale is only
a feature of compositing, and the code paths and VisualViewport are not
used when compositing is disabled. Secondly, the same holds when the
main frame is remote.
[email protected], [email protected]
Bug: 912193
Change-Id: Ie8312a15ca515917fc80c75dc6371426dd3d4da4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1530825
Commit-Queue: danakj <[email protected]>
Reviewed-by: Daniel Cheng <[email protected]>
Reviewed-by: James MacLean <[email protected]>
Cr-Commit-Position: refs/heads/master@{#644946}
diff --git a/content/renderer/render_widget.h b/content/renderer/render_widget.h
index 0575848..cfdd95f 100644
--- a/content/renderer/render_widget.h
+++ b/content/renderer/render_widget.h
@@ -438,6 +438,13 @@
bool up,
bool down) override;
void FallbackCursorModeSetCursorVisibility(bool visible) override;
+ void SetPageScaleFactorAndLimits(float page_scale_factor,
+ float minimum,
+ float maximum) override;
+ void StartPageScaleAnimation(const gfx::Vector2d& destination,
+ bool use_anchor,
+ float new_page_scale,
+ double duration_sec) override;
// Override point to obtain that the current input method state and caret
// position.
@@ -549,6 +556,9 @@
return last_capture_sequence_number_;
}
+ // Returns true if a page scale animation is active.
+ bool HasPendingPageScaleAnimation() const;
+
// MainThreadEventQueueClient overrides.
bool HandleInputEvent(const blink::WebCoalescedInputEvent& input_event,
const ui::LatencyInfo& latency_info,