Index: content/browser/host_zoom_map_impl.cc |
diff --git a/content/browser/host_zoom_map_impl.cc b/content/browser/host_zoom_map_impl.cc |
index 97f15ddc7da338730a4a0f81b9d251b3f717f355..b21665ddadfd95acdd23eeb067c09f6c58d588db 100644 |
--- a/content/browser/host_zoom_map_impl.cc |
+++ b/content/browser/host_zoom_map_impl.cc |
@@ -143,6 +143,24 @@ void HostZoomMapImpl::CopyFrom(HostZoomMap* copy_interface) { |
default_zoom_level_ = copy->default_zoom_level_; |
} |
+void HostZoomMapImpl::PreserveTemporaryZoomLevelFrom( |
+ const HostZoomMap* copy_interface, RenderFrameHost* old_host, |
+ RenderFrameHost* new_host) { |
+ const HostZoomMapImpl* copy = |
+ static_cast<const HostZoomMapImpl*>(copy_interface); |
+ const RenderViewHost* old_view_host = old_host->GetRenderViewHost(); |
+ const RenderViewHost* new_view_host = new_host->GetRenderViewHost(); |
+ |
+ DCHECK(copy->UsesTemporaryZoomLevel(old_view_host->GetProcess()->GetID(), |
+ old_view_host->GetRoutingID())); |
+ |
+ const double level = copy->GetTemporaryZoomLevel( |
+ old_view_host->GetProcess()->GetID(), old_view_host->GetRoutingID()); |
+ SetTemporaryZoomLevel( |
+ new_view_host->GetProcess()->GetID(), new_view_host->GetRoutingID(), |
+ level); |
+} |
+ |
double HostZoomMapImpl::GetZoomLevelForHost(const std::string& host) const { |
base::AutoLock auto_lock(lock_); |
return GetZoomLevelForHostInternal(host); |