Commit 38a3ea1d 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=karandeepb@chromium.org

Bug: 1142671
Change-Id: I8c2164e9841f1470aba590d8b8a3e4e1c2d116c9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2500211
Auto-Submit: Lucas Gadani <lfg@chromium.org>
Reviewed-by: default avatarKaran Bhatia <karandeepb@chromium.org>
Commit-Queue: Karan Bhatia <karandeepb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#821182}
parent 02ad74e1
...@@ -94,7 +94,7 @@ class DeclarativeContentCssConditionTrackerTest ...@@ -94,7 +94,7 @@ class DeclarativeContentCssConditionTrackerTest
content::WebContents* tab, content::WebContents* tab,
const std::vector<std::string>& selectors) { const std::vector<std::string>& selectors) {
ExtensionHostMsg_OnWatchedPageChange page_change( ExtensionHostMsg_OnWatchedPageChange page_change(
tab->GetRenderViewHost()->GetRoutingID(), selectors); tab->GetMainFrame()->GetRenderViewHost()->GetRoutingID(), selectors);
EXPECT_TRUE(GetMockRenderProcessHost(tab)->OnMessageReceived(page_change)); EXPECT_TRUE(GetMockRenderProcessHost(tab)->OnMessageReceived(page_change));
} }
......
...@@ -364,6 +364,7 @@ IN_PROC_BROWSER_TEST_F(AppApiTest, MAYBE_BookmarkAppGetsNormalProcess) { ...@@ -364,6 +364,7 @@ IN_PROC_BROWSER_TEST_F(AppApiTest, MAYBE_BookmarkAppGetsNormalProcess) {
content::RenderProcessHost* old_process = browser() content::RenderProcessHost* old_process = browser()
->tab_strip_model() ->tab_strip_model()
->GetWebContentsAt(2) ->GetWebContentsAt(2)
->GetMainFrame()
->GetRenderViewHost() ->GetRenderViewHost()
->GetProcess(); ->GetProcess();
NavigateInRenderer(browser()->tab_strip_model()->GetWebContentsAt(2), NavigateInRenderer(browser()->tab_strip_model()->GetWebContentsAt(2),
......
...@@ -41,8 +41,10 @@ void MouseDownInWebContents(content::WebContents* web_contents) { ...@@ -41,8 +41,10 @@ void MouseDownInWebContents(content::WebContents* web_contents) {
mouse_event.button = blink::WebMouseEvent::Button::kLeft; mouse_event.button = blink::WebMouseEvent::Button::kLeft;
mouse_event.SetPositionInWidget(10, 10); mouse_event.SetPositionInWidget(10, 10);
mouse_event.click_count = 1; mouse_event.click_count = 1;
web_contents->GetRenderViewHost()->GetWidget()->ForwardMouseEvent( web_contents->GetMainFrame()
mouse_event); ->GetRenderViewHost()
->GetWidget()
->ForwardMouseEvent(mouse_event);
} }
void MouseUpInWebContents(content::WebContents* web_contents) { void MouseUpInWebContents(content::WebContents* web_contents) {
...@@ -52,8 +54,10 @@ void MouseUpInWebContents(content::WebContents* web_contents) { ...@@ -52,8 +54,10 @@ void MouseUpInWebContents(content::WebContents* web_contents) {
mouse_event.button = blink::WebMouseEvent::Button::kLeft; mouse_event.button = blink::WebMouseEvent::Button::kLeft;
mouse_event.SetPositionInWidget(10, 10); mouse_event.SetPositionInWidget(10, 10);
mouse_event.click_count = 1; mouse_event.click_count = 1;
web_contents->GetRenderViewHost()->GetWidget()->ForwardMouseEvent( web_contents->GetMainFrame()
mouse_event); ->GetRenderViewHost()
->GetWidget()
->ForwardMouseEvent(mouse_event);
} }
class ExtensionBindingsApiTest : public ExtensionApiTest { class ExtensionBindingsApiTest : public ExtensionApiTest {
......
...@@ -90,8 +90,12 @@ ExtensionViewHost::ExtensionViewHost(const Extension* extension, ...@@ -90,8 +90,12 @@ ExtensionViewHost::ExtensionViewHost(const Extension* extension,
content::HostZoomMap* zoom_map = content::HostZoomMap* zoom_map =
content::HostZoomMap::GetForWebContents(host_contents()); content::HostZoomMap::GetForWebContents(host_contents());
zoom_map->SetTemporaryZoomLevel( zoom_map->SetTemporaryZoomLevel(
host_contents()->GetRenderViewHost()->GetProcess()->GetID(), host_contents()
host_contents()->GetRenderViewHost()->GetRoutingID(), ->GetMainFrame()
->GetRenderViewHost()
->GetProcess()
->GetID(),
host_contents()->GetMainFrame()->GetRenderViewHost()->GetRoutingID(),
zoom_map->GetDefaultZoomLevel()); zoom_map->GetDefaultZoomLevel());
} }
} }
......
...@@ -597,11 +597,11 @@ void WebstoreInstaller::StartDownload(const std::string& extension_id, ...@@ -597,11 +597,11 @@ void WebstoreInstaller::StartDownload(const std::string& extension_id,
ReportFailure(kDownloadDirectoryError, FAILURE_REASON_OTHER); ReportFailure(kDownloadDirectoryError, FAILURE_REASON_OTHER);
return; return;
} }
if (!contents->GetRenderViewHost()) { if (!contents->GetMainFrame()->GetRenderViewHost()) {
ReportFailure(kDownloadDirectoryError, FAILURE_REASON_OTHER); ReportFailure(kDownloadDirectoryError, FAILURE_REASON_OTHER);
return; return;
} }
if (!contents->GetRenderViewHost()->GetProcess()) { if (!contents->GetMainFrame()->GetRenderViewHost()->GetProcess()) {
ReportFailure(kDownloadDirectoryError, FAILURE_REASON_OTHER); ReportFailure(kDownloadDirectoryError, FAILURE_REASON_OTHER);
return; return;
} }
...@@ -620,7 +620,7 @@ void WebstoreInstaller::StartDownload(const std::string& extension_id, ...@@ -620,7 +620,7 @@ void WebstoreInstaller::StartDownload(const std::string& extension_id,
// We will navigate the current tab to this url to start the download. The // We will navigate the current tab to this url to start the download. The
// download system will then pass the crx to the CrxInstaller. // download system will then pass the crx to the CrxInstaller.
int render_process_host_id = int render_process_host_id =
contents->GetRenderViewHost()->GetProcess()->GetID(); contents->GetMainFrame()->GetRenderViewHost()->GetProcess()->GetID();
content::RenderFrameHost* render_frame_host = contents->GetMainFrame(); content::RenderFrameHost* render_frame_host = contents->GetMainFrame();
net::NetworkTrafficAnnotationTag traffic_annotation = net::NetworkTrafficAnnotationTag traffic_annotation =
......
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