OLD | NEW |
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 Loading... |
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 double zoom_level = host_zoom_map->GetZoomLevelForView( |
| 205 request_url, render_process_id, render_view_id); |
| 206 |
200 info->filter()->Send(new ViewMsg_SetZoomLevelForLoadingURL( | 207 info->filter()->Send(new ViewMsg_SetZoomLevelForLoadingURL( |
201 info->GetRouteID(), | 208 render_view_id, request_url, zoom_level)); |
202 request_url, host_zoom_map->GetZoomLevelForHostAndScheme( | |
203 request_url.scheme(), | |
204 net::GetHostOrSpecFromURL(request_url)))); | |
205 } | 209 } |
206 | 210 |
207 // If the parent handler downloaded the resource to a file, grant the child | 211 // If the parent handler downloaded the resource to a file, grant the child |
208 // read permissions on it. | 212 // read permissions on it. |
209 if (!response->head.download_file_path.empty()) { | 213 if (!response->head.download_file_path.empty()) { |
210 rdh_->RegisterDownloadedTempFile( | 214 rdh_->RegisterDownloadedTempFile( |
211 info->GetChildID(), info->GetRequestID(), | 215 info->GetChildID(), info->GetRequestID(), |
212 response->head.download_file_path); | 216 response->head.download_file_path); |
213 } | 217 } |
214 | 218 |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
400 request()->LogUnblocked(); | 404 request()->LogUnblocked(); |
401 controller()->Resume(); | 405 controller()->Resume(); |
402 } | 406 } |
403 } | 407 } |
404 | 408 |
405 void AsyncResourceHandler::OnDefer() { | 409 void AsyncResourceHandler::OnDefer() { |
406 request()->LogBlockedBy("AsyncResourceHandler"); | 410 request()->LogBlockedBy("AsyncResourceHandler"); |
407 } | 411 } |
408 | 412 |
409 } // namespace content | 413 } // namespace content |
OLD | NEW |