| 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 "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 <string> |
| 8 |
| 7 #include "base/logging.h" | 9 #include "base/logging.h" |
| 8 #include "chrome/browser/browser_process.h" | 10 #include "chrome/browser/browser_process.h" |
| 9 #include "chrome/browser/content_settings/host_content_settings_map.h" | 11 #include "chrome/browser/content_settings/host_content_settings_map.h" |
| 10 #include "chrome/browser/download/download_request_limiter.h" | 12 #include "chrome/browser/download/download_request_limiter.h" |
| 11 #include "chrome/browser/download/download_resource_throttle.h" | 13 #include "chrome/browser/download/download_resource_throttle.h" |
| 12 #include "chrome/browser/download/download_util.h" | 14 #include "chrome/browser/download/download_util.h" |
| 13 #include "chrome/browser/extensions/user_script_listener.h" | 15 #include "chrome/browser/extensions/user_script_listener.h" |
| 14 #include "chrome/browser/external_protocol/external_protocol_handler.h" | 16 #include "chrome/browser/external_protocol/external_protocol_handler.h" |
| 15 #include "chrome/browser/instant/instant_loader.h" | 17 #include "chrome/browser/instant/instant_loader.h" |
| 16 #include "chrome/browser/net/load_timing_observer.h" | 18 #include "chrome/browser/net/load_timing_observer.h" |
| (...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 315 const ResourceRequestInfo* info = ResourceRequestInfo::ForRequest(request); | 317 const ResourceRequestInfo* info = ResourceRequestInfo::ForRequest(request); |
| 316 | 318 |
| 317 if (request->url().SchemeIsSecure()) { | 319 if (request->url().SchemeIsSecure()) { |
| 318 const net::URLRequestContext* context = request->context(); | 320 const net::URLRequestContext* context = request->context(); |
| 319 net::TransportSecurityState* state = context->transport_security_state(); | 321 net::TransportSecurityState* state = context->transport_security_state(); |
| 320 if (state) { | 322 if (state) { |
| 321 net::TransportSecurityState::DomainState domain_state; | 323 net::TransportSecurityState::DomainState domain_state; |
| 322 bool has_sni = net::SSLConfigService::IsSNIAvailable( | 324 bool has_sni = net::SSLConfigService::IsSNIAvailable( |
| 323 context->ssl_config_service()); | 325 context->ssl_config_service()); |
| 324 if (state->GetDomainState( | 326 if (state->GetDomainState( |
| 325 &domain_state, request->url().host(), has_sni)) { | 327 request->url().host(), has_sni, &domain_state)) { |
| 326 sender->Send(new ChromeViewMsg_AddStrictSecurityHost( | 328 sender->Send(new ChromeViewMsg_AddStrictSecurityHost( |
| 327 info->GetRouteID(), request->url().host())); | 329 info->GetRouteID(), request->url().host())); |
| 328 } | 330 } |
| 329 } | 331 } |
| 330 } | 332 } |
| 331 | 333 |
| 332 // See if the response contains the X-Auto-Login header. If so, this was | 334 // See if the response contains the X-Auto-Login header. If so, this was |
| 333 // a request for a login page, and the server is allowing the browser to | 335 // a request for a login page, and the server is allowing the browser to |
| 334 // suggest auto-login, if available. | 336 // suggest auto-login, if available. |
| 335 AutoLoginPrompter::ShowInfoBarIfPossible(request, info->GetChildID(), | 337 AutoLoginPrompter::ShowInfoBarIfPossible(request, info->GetChildID(), |
| 336 info->GetRouteID()); | 338 info->GetRouteID()); |
| 337 } | 339 } |
| 338 | 340 |
| 339 void ChromeResourceDispatcherHostDelegate::OnRequestRedirected( | 341 void ChromeResourceDispatcherHostDelegate::OnRequestRedirected( |
| 340 net::URLRequest* request, | 342 net::URLRequest* request, |
| 341 content::ResourceResponse* response) { | 343 content::ResourceResponse* response) { |
| 342 LoadTimingObserver::PopulateTimingInfo(request, response); | 344 LoadTimingObserver::PopulateTimingInfo(request, response); |
| 343 | 345 |
| 344 #if defined(ENABLE_ONE_CLICK_SIGNIN) | 346 #if defined(ENABLE_ONE_CLICK_SIGNIN) |
| 345 const ResourceRequestInfo* info = ResourceRequestInfo::ForRequest(request); | 347 const ResourceRequestInfo* info = ResourceRequestInfo::ForRequest(request); |
| 346 | 348 |
| 347 // See if the response contains the Google-Accounts-SignIn header. If so, | 349 // See if the response contains the Google-Accounts-SignIn header. If so, |
| 348 // then the user has just finished signing in, and the server is allowing the | 350 // then the user has just finished signing in, and the server is allowing the |
| 349 // browser to suggest connecting the user's profile to the account. | 351 // browser to suggest connecting the user's profile to the account. |
| 350 OneClickSigninHelper::ShowInfoBarIfPossible(request, info->GetChildID(), | 352 OneClickSigninHelper::ShowInfoBarIfPossible(request, info->GetChildID(), |
| 351 info->GetRouteID()); | 353 info->GetRouteID()); |
| 352 #endif | 354 #endif |
| 353 } | 355 } |
| OLD | NEW |