summaryrefslogtreecommitdiff
path: root/chromium/components/zoom/zoom_controller.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/components/zoom/zoom_controller.cc')
-rw-r--r--chromium/components/zoom/zoom_controller.cc26
1 files changed, 16 insertions, 10 deletions
diff --git a/chromium/components/zoom/zoom_controller.cc b/chromium/components/zoom/zoom_controller.cc
index a581483193a..68ba2fa83ee 100644
--- a/chromium/components/zoom/zoom_controller.cc
+++ b/chromium/components/zoom/zoom_controller.cc
@@ -111,7 +111,7 @@ bool ZoomController::SetZoomLevelByClient(
// Cannot zoom in disabled mode. Also, don't allow changing zoom level on
// a crashed tab, an error page or an interstitial page.
if (zoom_mode_ == ZOOM_MODE_DISABLED ||
- !web_contents()->GetMainFrame()->IsRenderFrameLive())
+ !web_contents()->GetPrimaryMainFrame()->IsRenderFrameLive())
return false;
// Store client data so the |client| can be attributed when the zoom
@@ -157,12 +157,14 @@ bool ZoomController::SetZoomLevelByClient(
web_contents(), GetZoomLevel(), zoom_level, zoom_mode_,
false /* can_show_bubble */);
int process_id = web_contents()
- ->GetMainFrame()
+ ->GetPrimaryMainFrame()
->GetRenderViewHost()
->GetProcess()
->GetID();
- int view_id =
- web_contents()->GetMainFrame()->GetRenderViewHost()->GetRoutingID();
+ int view_id = web_contents()
+ ->GetPrimaryMainFrame()
+ ->GetRenderViewHost()
+ ->GetRoutingID();
if (zoom_mode_ == ZOOM_MODE_ISOLATED ||
zoom_map->UsesTemporaryZoomLevel(process_id, view_id)) {
zoom_map->SetTemporaryZoomLevel(process_id, view_id, zoom_level);
@@ -193,12 +195,14 @@ void ZoomController::SetZoomMode(ZoomMode new_mode) {
content::HostZoomMap::GetForWebContents(web_contents());
DCHECK(zoom_map);
int process_id = web_contents()
- ->GetMainFrame()
+ ->GetPrimaryMainFrame()
->GetRenderViewHost()
->GetProcess()
->GetID();
- int view_id =
- web_contents()->GetMainFrame()->GetRenderViewHost()->GetRoutingID();
+ int view_id = web_contents()
+ ->GetPrimaryMainFrame()
+ ->GetRenderViewHost()
+ ->GetRoutingID();
double original_zoom_level = GetZoomLevel();
DCHECK(!event_data_);
@@ -289,12 +293,14 @@ void ZoomController::ResetZoomModeOnNavigationIfNeeded(const GURL& url) {
return;
int process_id = web_contents()
- ->GetMainFrame()
+ ->GetPrimaryMainFrame()
->GetRenderViewHost()
->GetProcess()
->GetID();
- int view_id =
- web_contents()->GetMainFrame()->GetRenderViewHost()->GetRoutingID();
+ int view_id = web_contents()
+ ->GetPrimaryMainFrame()
+ ->GetRenderViewHost()
+ ->GetRoutingID();
content::HostZoomMap* zoom_map =
content::HostZoomMap::GetForWebContents(web_contents());
zoom_level_ = zoom_map->GetDefaultZoomLevel();