OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.
h" | 5 #include "chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.
h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "chrome/browser/browser_process.h" | 8 #include "chrome/browser/browser_process.h" |
9 #include "chrome/browser/content_settings/host_content_settings_map.h" | 9 #include "chrome/browser/content_settings/host_content_settings_map.h" |
10 #include "chrome/browser/download/download_request_limiter.h" | 10 #include "chrome/browser/download/download_request_limiter.h" |
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
299 #endif | 299 #endif |
300 | 300 |
301 bool ChromeResourceDispatcherHostDelegate::ShouldForceDownloadResource( | 301 bool ChromeResourceDispatcherHostDelegate::ShouldForceDownloadResource( |
302 const GURL& url, const std::string& mime_type) { | 302 const GURL& url, const std::string& mime_type) { |
303 // Special-case user scripts to get downloaded instead of viewed. | 303 // Special-case user scripts to get downloaded instead of viewed. |
304 return UserScript::IsURLUserScript(url, mime_type); | 304 return UserScript::IsURLUserScript(url, mime_type); |
305 } | 305 } |
306 | 306 |
307 void ChromeResourceDispatcherHostDelegate::OnResponseStarted( | 307 void ChromeResourceDispatcherHostDelegate::OnResponseStarted( |
308 net::URLRequest* request, | 308 net::URLRequest* request, |
309 ResourceResponse* response, | 309 content::ResourceResponse* response, |
310 ResourceMessageFilter* filter) { | 310 ResourceMessageFilter* filter) { |
311 LoadTimingObserver::PopulateTimingInfo(request, response); | 311 LoadTimingObserver::PopulateTimingInfo(request, response); |
312 | 312 |
313 ResourceDispatcherHostRequestInfo* info = | 313 ResourceDispatcherHostRequestInfo* info = |
314 resource_dispatcher_host_->InfoForRequest(request); | 314 resource_dispatcher_host_->InfoForRequest(request); |
315 | 315 |
316 if (request->url().SchemeIsSecure()) { | 316 if (request->url().SchemeIsSecure()) { |
317 const net::URLRequestContext* context = request->context(); | 317 const net::URLRequestContext* context = request->context(); |
318 net::TransportSecurityState* state = context->transport_security_state(); | 318 net::TransportSecurityState* state = context->transport_security_state(); |
319 if (state) { | 319 if (state) { |
(...skipping 12 matching lines...) Expand all Loading... |
332 | 332 |
333 // See if the response contains the X-Auto-Login header. If so, this was | 333 // See if the response contains the X-Auto-Login header. If so, this was |
334 // a request for a login page, and the server is allowing the browser to | 334 // a request for a login page, and the server is allowing the browser to |
335 // suggest auto-login, if available. | 335 // suggest auto-login, if available. |
336 AutoLoginPrompter::ShowInfoBarIfPossible(request, info->child_id(), | 336 AutoLoginPrompter::ShowInfoBarIfPossible(request, info->child_id(), |
337 info->route_id()); | 337 info->route_id()); |
338 } | 338 } |
339 | 339 |
340 void ChromeResourceDispatcherHostDelegate::OnRequestRedirected( | 340 void ChromeResourceDispatcherHostDelegate::OnRequestRedirected( |
341 net::URLRequest* request, | 341 net::URLRequest* request, |
342 ResourceResponse* response, | 342 content::ResourceResponse* response, |
343 ResourceMessageFilter* filter) { | 343 ResourceMessageFilter* filter) { |
344 LoadTimingObserver::PopulateTimingInfo(request, response); | 344 LoadTimingObserver::PopulateTimingInfo(request, response); |
345 } | 345 } |
OLD | NEW |