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> | 7 #include <string> |
8 | 8 |
9 #include "base/base64.h" | 9 #include "base/base64.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 538 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
549 } | 549 } |
550 | 550 |
551 void ChromeResourceDispatcherHostDelegate::OnResponseStarted( | 551 void ChromeResourceDispatcherHostDelegate::OnResponseStarted( |
552 net::URLRequest* request, | 552 net::URLRequest* request, |
553 content::ResourceContext* resource_context, | 553 content::ResourceContext* resource_context, |
554 content::ResourceResponse* response, | 554 content::ResourceResponse* response, |
555 IPC::Sender* sender) { | 555 IPC::Sender* sender) { |
556 const ResourceRequestInfo* info = ResourceRequestInfo::ForRequest(request); | 556 const ResourceRequestInfo* info = ResourceRequestInfo::ForRequest(request); |
557 | 557 |
558 if (request->url().SchemeIsSecure()) { | 558 if (request->url().SchemeIsSecure()) { |
559 const net::URLRequestContext* context = request->context(); | 559 if (request->GetHSTSRedirect(NULL)) { |
560 net::TransportSecurityState* state = context->transport_security_state(); | |
561 if (state) { | |
562 net::TransportSecurityState::DomainState domain_state; | |
563 bool has_sni = net::SSLConfigService::IsSNIAvailable( | |
564 context->ssl_config_service()); | |
565 if (state->GetDomainState(request->url().host(), has_sni, | |
566 &domain_state) && | |
567 domain_state.ShouldUpgradeToSSL()) { | |
568 sender->Send(new ChromeViewMsg_AddStrictSecurityHost( | 560 sender->Send(new ChromeViewMsg_AddStrictSecurityHost( |
569 info->GetRouteID(), request->url().host())); | 561 info->GetRouteID(), request->url().host())); |
570 } | |
571 } | 562 } |
572 } | 563 } |
573 | 564 |
574 // See if the response contains the X-Auto-Login header. If so, this was | 565 // See if the response contains the X-Auto-Login header. If so, this was |
575 // a request for a login page, and the server is allowing the browser to | 566 // a request for a login page, and the server is allowing the browser to |
576 // suggest auto-login, if available. | 567 // suggest auto-login, if available. |
577 AutoLoginPrompter::ShowInfoBarIfPossible(request, info->GetChildID(), | 568 AutoLoginPrompter::ShowInfoBarIfPossible(request, info->GetChildID(), |
578 info->GetRouteID()); | 569 info->GetRouteID()); |
579 | 570 |
580 ProfileIOData* io_data = ProfileIOData::FromResourceContext(resource_context); | 571 ProfileIOData* io_data = ProfileIOData::FromResourceContext(resource_context); |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
633 if (!prerender::PrerenderManager::DoesURLHaveValidScheme(redirect_url) && | 624 if (!prerender::PrerenderManager::DoesURLHaveValidScheme(redirect_url) && |
634 ResourceRequestInfo::ForRequest(request)->GetAssociatedRenderView( | 625 ResourceRequestInfo::ForRequest(request)->GetAssociatedRenderView( |
635 &child_id, &route_id) && | 626 &child_id, &route_id) && |
636 prerender_tracker_->IsPrerenderingOnIOThread(child_id, route_id)) { | 627 prerender_tracker_->IsPrerenderingOnIOThread(child_id, route_id)) { |
637 ReportUnsupportedPrerenderScheme(redirect_url); | 628 ReportUnsupportedPrerenderScheme(redirect_url); |
638 prerender_tracker_->TryCancel( | 629 prerender_tracker_->TryCancel( |
639 child_id, route_id, prerender::FINAL_STATUS_UNSUPPORTED_SCHEME); | 630 child_id, route_id, prerender::FINAL_STATUS_UNSUPPORTED_SCHEME); |
640 request->Cancel(); | 631 request->Cancel(); |
641 } | 632 } |
642 } | 633 } |
OLD | NEW |