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

Side by Side 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: Revise as per comments. Created 5 years, 10 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/loader/async_resource_handler.h" 5 #include "content/browser/loader/async_resource_handler.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 if (!info->filter()) 186 if (!info->filter())
187 return false; 187 return false;
188 188
189 if (rdh_->delegate()) { 189 if (rdh_->delegate()) {
190 rdh_->delegate()->OnResponseStarted( 190 rdh_->delegate()->OnResponseStarted(
191 request(), info->GetContext(), response, info->filter()); 191 request(), info->GetContext(), response, info->filter());
192 } 192 }
193 193
194 DevToolsNetLogObserver::PopulateResponseInfo(request(), response); 194 DevToolsNetLogObserver::PopulateResponseInfo(request(), response);
195 195
196 const HostZoomMap* host_zoom_map = info->filter()->GetHostZoomMap(); 196 const HostZoomMapImpl* host_zoom_map =
197 static_cast<const HostZoomMapImpl*>(info->filter()->GetHostZoomMap());
197 198
198 if (info->GetResourceType() == RESOURCE_TYPE_MAIN_FRAME && host_zoom_map) { 199 if (info->GetResourceType() == RESOURCE_TYPE_MAIN_FRAME && host_zoom_map) {
199 const GURL& request_url = request()->url(); 200 const GURL& request_url = request()->url();
201 int render_process_id = info->GetChildID();
202 int render_view_id = info->GetRouteID();
203
204 // TODO(wjmaclean): verify that using the full request url (without passing
205 // an empty scheme as we used to) doesn't break anything.
Charlie Reis 2015/02/11 20:56:34 This doesn't instill confidence. :) Can we test
wjmaclean 2015/02/12 15:59:36 Gah, just realized we're not changing anything! *M
206 double zoom_level = host_zoom_map->GetZoomLevelForView(
207 request_url, render_process_id, render_view_id);
208
200 info->filter()->Send(new ViewMsg_SetZoomLevelForLoadingURL( 209 info->filter()->Send(new ViewMsg_SetZoomLevelForLoadingURL(
201 info->GetRouteID(), 210 render_view_id, request_url, zoom_level));
202 request_url, host_zoom_map->GetZoomLevelForHostAndScheme(
203 request_url.scheme(),
204 net::GetHostOrSpecFromURL(request_url))));
205 } 211 }
206 212
207 // If the parent handler downloaded the resource to a file, grant the child 213 // If the parent handler downloaded the resource to a file, grant the child
208 // read permissions on it. 214 // read permissions on it.
209 if (!response->head.download_file_path.empty()) { 215 if (!response->head.download_file_path.empty()) {
210 rdh_->RegisterDownloadedTempFile( 216 rdh_->RegisterDownloadedTempFile(
211 info->GetChildID(), info->GetRequestID(), 217 info->GetChildID(), info->GetRequestID(),
212 response->head.download_file_path); 218 response->head.download_file_path);
213 } 219 }
214 220
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
400 request()->LogUnblocked(); 406 request()->LogUnblocked();
401 controller()->Resume(); 407 controller()->Resume();
402 } 408 }
403 } 409 }
404 410
405 void AsyncResourceHandler::OnDefer() { 411 void AsyncResourceHandler::OnDefer() {
406 request()->LogBlockedBy("AsyncResourceHandler"); 412 request()->LogBlockedBy("AsyncResourceHandler");
407 } 413 }
408 414
409 } // namespace content 415 } // namespace content
OLDNEW
« content/browser/host_zoom_map_impl.h ('K') | « content/browser/host_zoom_map_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698