Commit 336946e2 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=wjmaclean@chromium.org

Bug: 1142671
Change-Id: I5fa2ec983348148bb2628281c61d2c0a9e213e7f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2500574
Auto-Submit: Lucas Gadani <lfg@chromium.org>
Reviewed-by: default avatarJames MacLean <wjmaclean@chromium.org>
Commit-Queue: James MacLean <wjmaclean@chromium.org>
Cr-Commit-Position: refs/heads/master@{#821234}
parent 18d2c423
...@@ -112,7 +112,7 @@ bool ZoomController::SetZoomLevelByClient( ...@@ -112,7 +112,7 @@ bool ZoomController::SetZoomLevelByClient(
// Cannot zoom in disabled mode. Also, don't allow changing zoom level on // Cannot zoom in disabled mode. Also, don't allow changing zoom level on
// a crashed tab, an error page or an interstitial page. // a crashed tab, an error page or an interstitial page.
if (zoom_mode_ == ZOOM_MODE_DISABLED || if (zoom_mode_ == ZOOM_MODE_DISABLED ||
!web_contents()->GetRenderViewHost()->IsRenderViewLive()) !web_contents()->GetMainFrame()->GetRenderViewHost()->IsRenderViewLive())
return false; return false;
// Store client data so the |client| can be attributed when the zoom // Store client data so the |client| can be attributed when the zoom
...@@ -157,8 +157,13 @@ bool ZoomController::SetZoomLevelByClient( ...@@ -157,8 +157,13 @@ bool ZoomController::SetZoomLevelByClient(
event_data_.reset(new ZoomChangedEventData(web_contents(), GetZoomLevel(), event_data_.reset(new ZoomChangedEventData(web_contents(), GetZoomLevel(),
zoom_level, zoom_mode_, zoom_level, zoom_mode_,
false /* can_show_bubble */)); false /* can_show_bubble */));
int process_id = web_contents()->GetRenderViewHost()->GetProcess()->GetID(); int process_id = web_contents()
int view_id = web_contents()->GetRenderViewHost()->GetRoutingID(); ->GetMainFrame()
->GetRenderViewHost()
->GetProcess()
->GetID();
int view_id =
web_contents()->GetMainFrame()->GetRenderViewHost()->GetRoutingID();
if (zoom_mode_ == ZOOM_MODE_ISOLATED || if (zoom_mode_ == ZOOM_MODE_ISOLATED ||
zoom_map->UsesTemporaryZoomLevel(process_id, view_id)) { zoom_map->UsesTemporaryZoomLevel(process_id, view_id)) {
zoom_map->SetTemporaryZoomLevel(process_id, view_id, zoom_level); zoom_map->SetTemporaryZoomLevel(process_id, view_id, zoom_level);
...@@ -188,8 +193,13 @@ void ZoomController::SetZoomMode(ZoomMode new_mode) { ...@@ -188,8 +193,13 @@ void ZoomController::SetZoomMode(ZoomMode new_mode) {
content::HostZoomMap* zoom_map = content::HostZoomMap* zoom_map =
content::HostZoomMap::GetForWebContents(web_contents()); content::HostZoomMap::GetForWebContents(web_contents());
DCHECK(zoom_map); DCHECK(zoom_map);
int process_id = web_contents()->GetRenderViewHost()->GetProcess()->GetID(); int process_id = web_contents()
int view_id = web_contents()->GetRenderViewHost()->GetRoutingID(); ->GetMainFrame()
->GetRenderViewHost()
->GetProcess()
->GetID();
int view_id =
web_contents()->GetMainFrame()->GetRenderViewHost()->GetRoutingID();
double original_zoom_level = GetZoomLevel(); double original_zoom_level = GetZoomLevel();
DCHECK(!event_data_); DCHECK(!event_data_);
...@@ -279,8 +289,13 @@ void ZoomController::ResetZoomModeOnNavigationIfNeeded(const GURL& url) { ...@@ -279,8 +289,13 @@ void ZoomController::ResetZoomModeOnNavigationIfNeeded(const GURL& url) {
if (zoom_mode_ != ZOOM_MODE_ISOLATED && zoom_mode_ != ZOOM_MODE_MANUAL) if (zoom_mode_ != ZOOM_MODE_ISOLATED && zoom_mode_ != ZOOM_MODE_MANUAL)
return; return;
int process_id = web_contents()->GetRenderViewHost()->GetProcess()->GetID(); int process_id = web_contents()
int view_id = web_contents()->GetRenderViewHost()->GetRoutingID(); ->GetMainFrame()
->GetRenderViewHost()
->GetProcess()
->GetID();
int view_id =
web_contents()->GetMainFrame()->GetRenderViewHost()->GetRoutingID();
content::HostZoomMap* zoom_map = content::HostZoomMap* zoom_map =
content::HostZoomMap::GetForWebContents(web_contents()); content::HostZoomMap::GetForWebContents(web_contents());
zoom_level_ = zoom_map->GetDefaultZoomLevel(); zoom_level_ = zoom_map->GetDefaultZoomLevel();
...@@ -390,8 +405,13 @@ void ZoomController::UpdateState(const std::string& host) { ...@@ -390,8 +405,13 @@ void ZoomController::UpdateState(const std::string& host) {
} }
void ZoomController::SetPageScaleFactorIsOneForTesting(bool is_one) { void ZoomController::SetPageScaleFactorIsOneForTesting(bool is_one) {
int process_id = web_contents()->GetRenderViewHost()->GetProcess()->GetID(); int process_id = web_contents()
int view_id = web_contents()->GetRenderViewHost()->GetRoutingID(); ->GetMainFrame()
->GetRenderViewHost()
->GetProcess()
->GetID();
int view_id =
web_contents()->GetMainFrame()->GetRenderViewHost()->GetRoutingID();
host_zoom_map_->SetPageScaleFactorIsOneForView(process_id, view_id, is_one); host_zoom_map_->SetPageScaleFactorIsOneForView(process_id, view_id, is_one);
} }
......
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