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