Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1209)

Unified Diff: content/browser/host_zoom_map_impl.cc

Issue 2630583002: Add setting to isolate zoom changes by default. (Closed)
Patch Set: Add more tests. Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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);

Powered by Google App Engine
This is Rietveld 408576698