Skip to content

Commit

Permalink
Move IntrinsicSizingInfoChanged into base.
Browse files Browse the repository at this point in the history
We can move this implementation into base and DCHECK that it is only
called for subframes.

BUG=1097816

Change-Id: I0b89c52f1574507d5aea0b04ba4bcb4fb95bc8fc
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2536509
Commit-Queue: Dave Tapuska <[email protected]>
Reviewed-by: danakj <[email protected]>
Cr-Commit-Position: refs/heads/master@{#827844}
GitOrigin-RevId: 85348a7ee5b962a7178c57e2cc0eaacef3c48fbe
  • Loading branch information
dtapuska authored and copybara-github committed Nov 16, 2020
1 parent 5456f96 commit 16c5c4c
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
7 changes: 7 additions & 0 deletions blink/renderer/core/frame/web_frame_widget_base.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1911,6 +1911,13 @@ float WebFrameWidgetBase::GetEmulatorScale() {
return 1.0f;
}

void WebFrameWidgetBase::IntrinsicSizingInfoChanged(
mojom::blink::IntrinsicSizingInfoPtr sizing_info) {
DCHECK(ForSubframe());
GetAssociatedFrameWidgetHost()->IntrinsicSizingInfoChanged(
std::move(sizing_info));
}

void WebFrameWidgetBase::AutoscrollStart(const gfx::PointF& position) {
GetAssociatedFrameWidgetHost()->AutoscrollStart(std::move(position));
}
Expand Down
5 changes: 3 additions & 2 deletions blink/renderer/core/frame/web_frame_widget_base.h
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,9 @@ class CORE_EXPORT WebFrameWidgetBase
// Opposite of |ForSubframe|. If this widget is for the local main frame.
bool ForMainFrame() const { return !ForSubframe(); }

virtual void IntrinsicSizingInfoChanged(
mojom::blink::IntrinsicSizingInfoPtr) {}
// Called when the intrinsic size of the owning container is changing its
// size. This should only be called when `ForSubframe` is true.
void IntrinsicSizingInfoChanged(mojom::blink::IntrinsicSizingInfoPtr);

void AutoscrollStart(const gfx::PointF& position);
void AutoscrollFling(const gfx::Vector2dF& position);
Expand Down
6 changes: 0 additions & 6 deletions blink/renderer/core/frame/web_frame_widget_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -344,12 +344,6 @@ bool WebFrameWidgetImpl::ScrollFocusedEditableElementIntoView() {
return true;
}

void WebFrameWidgetImpl::IntrinsicSizingInfoChanged(
mojom::blink::IntrinsicSizingInfoPtr sizing_info) {
GetAssociatedFrameWidgetHost()->IntrinsicSizingInfoChanged(
std::move(sizing_info));
}

void WebFrameWidgetImpl::MouseCaptureLost() {
TRACE_EVENT_NESTABLE_ASYNC_END0("input", "capturing mouse",
TRACE_ID_LOCAL(this));
Expand Down
2 changes: 0 additions & 2 deletions blink/renderer/core/frame/web_frame_widget_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,6 @@ class WebFrameWidgetImpl final : public WebFrameWidgetBase {
// WebFrameWidgetBase overrides:
bool ForSubframe() const override { return true; }
bool ForTopLevelFrame() const override { return false; }
void IntrinsicSizingInfoChanged(
mojom::blink::IntrinsicSizingInfoPtr) override;
void DidCreateLocalRootView() override;
void ZoomToFindInPageRect(const WebRect& rect_in_root_frame) override;
void SetAutoResizeMode(bool auto_resize,
Expand Down

0 comments on commit 16c5c4c

Please sign in to comment.