Commit b2b7d0bf authored by Dave Tapuska's avatar Dave Tapuska Committed by Chromium LUCI CQ

Resolve TODOs on WebFrameWidgetImpl.

Make sure LayerTreeHost accessor is not on the public scope.
Remove stale TODO.

BUG=1097816

Change-Id: Icaa829177ff29683747a50ec2f82137e9f7a5080
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2570994
Commit-Queue: Dave Tapuska <dtapuska@chromium.org>
Reviewed-by: default avatardanakj <danakj@chromium.org>
Cr-Commit-Position: refs/heads/master@{#835710}
parent b4ac3fca
...@@ -578,17 +578,16 @@ void LocalFrameClientImpl::DispatchDidCommitLoad( ...@@ -578,17 +578,16 @@ void LocalFrameClientImpl::DispatchDidCommitLoad(
// a navigation on the main frame we setup the appropriate structures. // a navigation on the main frame we setup the appropriate structures.
if (web_frame_->GetFrame()->IsMainFrame() && if (web_frame_->GetFrame()->IsMainFrame() &&
web_frame_->ViewImpl()->does_composite()) { web_frame_->ViewImpl()->does_composite()) {
cc::LayerTreeHost* layer_tree_host = WebFrameWidgetImpl* frame_widget = web_frame_->FrameWidgetImpl();
web_frame_->FrameWidgetImpl()->LayerTreeHost();
// Update the URL and the document source id used to key UKM metrics in // Update the URL and the document source id used to key UKM metrics in
// the compositor. Note that the metrics for all frames are keyed to the // the compositor. Note that the metrics for all frames are keyed to the
// main frame's URL. // main frame's URL.
layer_tree_host->SetSourceURL( frame_widget->SetSourceURLForCompositor(
web_frame_->GetDocument().GetUkmSourceId(), web_frame_->GetDocument().GetUkmSourceId(),
KURL(web_frame_->Client()->LastCommittedUrlForUKM())); KURL(web_frame_->Client()->LastCommittedUrlForUKM()));
auto shmem = layer_tree_host->CreateSharedMemoryForSmoothnessUkm(); auto shmem = frame_widget->CreateSharedMemoryForSmoothnessUkm();
if (shmem.IsValid()) { if (shmem.IsValid()) {
web_frame_->Client()->SetUpSharedMemoryForSmoothness( web_frame_->Client()->SetUpSharedMemoryForSmoothness(
std::move(shmem)); std::move(shmem));
......
...@@ -3926,6 +3926,20 @@ WebPlugin* WebFrameWidgetImpl::GetFocusedPluginContainer() { ...@@ -3926,6 +3926,20 @@ WebPlugin* WebFrameWidgetImpl::GetFocusedPluginContainer() {
return nullptr; return nullptr;
} }
bool WebFrameWidgetImpl::HasPendingPageScaleAnimation() {
return LayerTreeHost()->HasPendingPageScaleAnimation();
}
void WebFrameWidgetImpl::SetSourceURLForCompositor(ukm::SourceId source_id,
const KURL& url) {
LayerTreeHost()->SetSourceURL(source_id, url);
}
base::ReadOnlySharedMemoryRegion
WebFrameWidgetImpl::CreateSharedMemoryForSmoothnessUkm() {
return LayerTreeHost()->CreateSharedMemoryForSmoothnessUkm();
}
bool WebFrameWidgetImpl::CanComposeInline() { bool WebFrameWidgetImpl::CanComposeInline() {
if (auto* plugin = GetFocusedPluginContainer()) if (auto* plugin = GetFocusedPluginContainer())
return plugin->CanComposeInline(); return plugin->CanComposeInline();
......
...@@ -311,9 +311,6 @@ class CORE_EXPORT WebFrameWidgetImpl ...@@ -311,9 +311,6 @@ class CORE_EXPORT WebFrameWidgetImpl
void SetDeviceScaleFactorForTesting(float factor) override; void SetDeviceScaleFactorForTesting(float factor) override;
void ZoomToFindInPageRect(const WebRect& rect_in_root_frame) override; void ZoomToFindInPageRect(const WebRect& rect_in_root_frame) override;
FrameWidgetTestHelper* GetFrameWidgetTestHelperForTesting() override; FrameWidgetTestHelper* GetFrameWidgetTestHelperForTesting() override;
// TODO(dtapuska): Move this into private scope to match the interface
// definition.
cc::LayerTreeHost* LayerTreeHost() override;
// Called when a drag-n-drop operation should begin. // Called when a drag-n-drop operation should begin.
virtual void StartDragging(const WebDragData&, virtual void StartDragging(const WebDragData&,
...@@ -570,6 +567,15 @@ class CORE_EXPORT WebFrameWidgetImpl ...@@ -570,6 +567,15 @@ class CORE_EXPORT WebFrameWidgetImpl
// Return the focused WebPlugin if there is one. // Return the focused WebPlugin if there is one.
WebPlugin* GetFocusedPluginContainer(); WebPlugin* GetFocusedPluginContainer();
// Return if there is a pending scale animation.
bool HasPendingPageScaleAnimation();
// Set the source URL for the compositor.
void SetSourceURLForCompositor(ukm::SourceId source_id, const KURL& url);
// Ask compositor to create the shared memory for smoothness ukm region.
base::ReadOnlySharedMemoryRegion CreateSharedMemoryForSmoothnessUkm();
protected: protected:
// WidgetBaseClient overrides: // WidgetBaseClient overrides:
void ScheduleAnimation() override; void ScheduleAnimation() override;
...@@ -582,6 +588,9 @@ class CORE_EXPORT WebFrameWidgetImpl ...@@ -582,6 +588,9 @@ class CORE_EXPORT WebFrameWidgetImpl
// overridden by tests to disable this. // overridden by tests to disable this.
virtual bool ShouldAutoDetermineCompositingToLCDTextSetting(); virtual bool ShouldAutoDetermineCompositingToLCDTextSetting();
// WebFrameWidget overrides.
cc::LayerTreeHost* LayerTreeHost() override;
bool doing_drag_and_drop_ = false; bool doing_drag_and_drop_ = false;
private: private:
...@@ -865,8 +874,6 @@ class CORE_EXPORT WebFrameWidgetImpl ...@@ -865,8 +874,6 @@ class CORE_EXPORT WebFrameWidgetImpl
bool is_pinch_gesture_active_in_mainframe_ = false; bool is_pinch_gesture_active_in_mainframe_ = false;
// If set, the (plugin) element which has mouse capture. // If set, the (plugin) element which has mouse capture.
// TODO(dtapuska): Move to private once all input handling is moved to
// base class.
Member<HTMLPlugInElement> mouse_capture_element_; Member<HTMLPlugInElement> mouse_capture_element_;
// The size of the widget in viewport coordinates. This is slightly different // The size of the widget in viewport coordinates. This is slightly different
......
...@@ -128,7 +128,7 @@ TEST_F(WebFrameWidgetSimTest, FrameSinkIdHitTestAPI) { ...@@ -128,7 +128,7 @@ TEST_F(WebFrameWidgetSimTest, FrameSinkIdHitTestAPI) {
#if defined(OS_ANDROID) #if defined(OS_ANDROID)
TEST_F(WebFrameWidgetSimTest, ForceSendMetadataOnInput) { TEST_F(WebFrameWidgetSimTest, ForceSendMetadataOnInput) {
cc::LayerTreeHost* layer_tree_host = cc::LayerTreeHost* layer_tree_host =
WebView().MainFrameViewWidget()->LayerTreeHost(); WebView().MainFrameViewWidget()->LayerTreeHostForTesting();
// We should not have any force send metadata requests at start. // We should not have any force send metadata requests at start.
EXPECT_FALSE(layer_tree_host->TakeForceSendMetadataRequest()); EXPECT_FALSE(layer_tree_host->TakeForceSendMetadataRequest());
// ShowVirtualKeyboard will trigger a text input state update. // ShowVirtualKeyboard will trigger a text input state update.
......
...@@ -2787,8 +2787,7 @@ void WebLocalFrameImpl::ScrollFocusedEditableElementIntoRect( ...@@ -2787,8 +2787,7 @@ void WebLocalFrameImpl::ScrollFocusedEditableElementIntoRect(
rect_for_scrolled_focused_editable_node_ = rect; rect_for_scrolled_focused_editable_node_ = rect;
has_scrolled_focused_editable_node_into_rect_ = true; has_scrolled_focused_editable_node_into_rect_ = true;
if (!local_root_frame_widget->LayerTreeHost() if (!local_root_frame_widget->HasPendingPageScaleAnimation() &&
->HasPendingPageScaleAnimation() &&
autofill_client_) { autofill_client_) {
autofill_client_->DidCompleteFocusChangeInFrame(); autofill_client_->DidCompleteFocusChangeInFrame();
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment