Commit 836c945e authored by Lucas Furukawa Gadani's avatar Lucas Furukawa Gadani Committed by Commit Bot

Remove usages of WebContents::GetRenderViewHost().

This CL was uploaded by git cl split.

R=hanxi@chromium.org

Bug: 1142671
Change-Id: I527f1a4dda878d289ac3542336b87737bd377f8f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2500590
Auto-Submit: Lucas Gadani <lfg@chromium.org>
Reviewed-by: default avatarXi Han <hanxi@chromium.org>
Commit-Queue: Xi Han <hanxi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#821422}
parent 293c504e
......@@ -73,10 +73,11 @@ void ExtensionsGuestViewManagerDelegate::DispatchEvent(
return; // Could happen at tab shutdown.
EventRouter::DispatchEventToSender(
owner->GetRenderViewHost(), guest->browser_context(), guest->owner_host(),
histogram_value, event_name, content::ChildProcessHost::kInvalidUniqueID,
extensions::kMainThreadId, blink::mojom::kInvalidServiceWorkerVersionId,
std::move(event_args), info);
owner->GetMainFrame()->GetRenderViewHost(), guest->browser_context(),
guest->owner_host(), histogram_value, event_name,
content::ChildProcessHost::kInvalidUniqueID, extensions::kMainThreadId,
blink::mojom::kInvalidServiceWorkerVersionId, std::move(event_args),
info);
}
bool ExtensionsGuestViewManagerDelegate::IsGuestAvailableToContext(
......
......@@ -583,8 +583,12 @@ int WebViewGuest::GetTaskPrefix() const {
void WebViewGuest::GuestDestroyed() {
WebViewRendererState::GetInstance()->RemoveGuest(
web_contents()->GetRenderViewHost()->GetProcess()->GetID(),
web_contents()->GetRenderViewHost()->GetRoutingID());
web_contents()
->GetMainFrame()
->GetRenderViewHost()
->GetProcess()
->GetID(),
web_contents()->GetMainFrame()->GetRenderViewHost()->GetRoutingID());
}
void WebViewGuest::GuestReady() {
......@@ -1090,8 +1094,13 @@ void WebViewGuest::PushWebViewStateToIOThread() {
web_view_info.embedder_process_id, web_view_info.instance_id);
WebViewRendererState::GetInstance()->AddGuest(
web_contents()->GetRenderViewHost()->GetProcess()->GetID(),
web_contents()->GetRenderViewHost()->GetRoutingID(), web_view_info);
web_contents()
->GetMainFrame()
->GetRenderViewHost()
->GetProcess()
->GetID(),
web_contents()->GetMainFrame()->GetRenderViewHost()->GetRoutingID(),
web_view_info);
}
void WebViewGuest::RequestMediaAccessPermission(
......@@ -1315,14 +1324,22 @@ void WebViewGuest::SetAllowTransparency(bool allow) {
return;
allow_transparency_ = allow;
if (!web_contents()->GetRenderViewHost()->GetWidget()->GetView())
if (!web_contents()
->GetMainFrame()
->GetRenderViewHost()
->GetWidget()
->GetView())
return;
SetTransparency();
}
void WebViewGuest::SetTransparency() {
auto* view = web_contents()->GetRenderViewHost()->GetWidget()->GetView();
auto* view = web_contents()
->GetMainFrame()
->GetRenderViewHost()
->GetWidget()
->GetView();
if (allow_transparency_)
view->SetBackgroundColor(SK_ColorTRANSPARENT);
else
......@@ -1650,6 +1667,7 @@ void WebViewGuest::SetFullscreenState(bool is_fullscreen) {
// Since we changed fullscreen state, sending a SynchronizeVisualProperties
// message ensures that renderer/ sees the change.
web_contents()
->GetMainFrame()
->GetRenderViewHost()
->GetWidget()
->SynchronizeVisualProperties();
......
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