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

Unified Diff: content/browser/loader/async_resource_handler.cc

Issue 809223006: Check temporary zoom status when sending zoom level in navigation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years 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/loader/async_resource_handler.cc
diff --git a/content/browser/loader/async_resource_handler.cc b/content/browser/loader/async_resource_handler.cc
index 51b0a744dc9b7f013c89f2f9b0d998553432581c..211e7f4f60ee5e266f02c983310e3b5e2e6d85cd 100644
--- a/content/browser/loader/async_resource_handler.cc
+++ b/content/browser/loader/async_resource_handler.cc
@@ -197,11 +197,26 @@ bool AsyncResourceHandler::OnResponseStarted(ResourceResponse* response,
if (info->GetResourceType() == RESOURCE_TYPE_MAIN_FRAME && host_zoom_map) {
const GURL& request_url = request()->url();
+ // TODO(wjmaclean): It would be nice if the AsyncResourceHandler didn't
+ // need to worry about whether a zoom level is temporary or not. Presumably
+ // this logic could move into HostZoomMap, in a function that is given
Charlie Reis 2015/02/11 18:34:31 +1 to moving this into a HostZoomMapImpl function.
wjmaclean 2015/02/11 20:29:34 Certainly. I wasn't sure about how much willingnes
+ // all the necessary inputs. An alternative would be if we could pass the
+ // WebContents* for the navigating page from here, though that may change
Charlie Reis 2015/02/11 18:34:31 We can't pass a WebContents here, since this is on
wjmaclean 2015/02/11 20:29:34 Hadn't thought of that, so thanks for pointing it
+ // the behaviour (e.g. navigations to a new origin will be handled
+ // properly too in that case).
+ int render_process_id = info->GetChildID();
+ int render_view_id = info->GetRouteID();
+ double zoom_level;
Charlie Reis 2015/02/11 18:34:31 nit: Initialize this.
wjmaclean 2015/02/11 20:29:34 Done.
+ if (host_zoom_map->UsesTemporaryZoomLevel(render_process_id,
+ render_view_id)) {
+ zoom_level = host_zoom_map->GetTemporaryZoomLevel(render_process_id,
Charlie Reis 2015/02/11 18:34:31 Can we cast this to HostZoomMapImpl so that we don
wjmaclean 2015/02/11 20:29:34 Done.
+ render_view_id);
+ } else {
+ zoom_level = host_zoom_map->GetZoomLevelForHostAndScheme(
+ request_url.scheme(), net::GetHostOrSpecFromURL(request_url));
+ }
info->filter()->Send(new ViewMsg_SetZoomLevelForLoadingURL(
- info->GetRouteID(),
- request_url, host_zoom_map->GetZoomLevelForHostAndScheme(
- request_url.scheme(),
- net::GetHostOrSpecFromURL(request_url))));
+ info->GetRouteID(), request_url, zoom_level));
}
// If the parent handler downloaded the resource to a file, grant the child

Powered by Google App Engine
This is Rietveld 408576698