| 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 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/base64.h" | 10 #include "base/base64.h" |
| (...skipping 644 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 655 // Ignores x-frame-options for the chrome signin UI. | 655 // Ignores x-frame-options for the chrome signin UI. |
| 656 const std::string request_spec( | 656 const std::string request_spec( |
| 657 request->first_party_for_cookies().GetOrigin().spec()); | 657 request->first_party_for_cookies().GetOrigin().spec()); |
| 658 #if defined(OS_CHROMEOS) | 658 #if defined(OS_CHROMEOS) |
| 659 if (request_spec == chrome::kChromeUIOobeURL || | 659 if (request_spec == chrome::kChromeUIOobeURL || |
| 660 request_spec == chrome::kChromeUIChromeSigninURL) { | 660 request_spec == chrome::kChromeUIChromeSigninURL) { |
| 661 #else | 661 #else |
| 662 if (request_spec == chrome::kChromeUIChromeSigninURL) { | 662 if (request_spec == chrome::kChromeUIChromeSigninURL) { |
| 663 #endif | 663 #endif |
| 664 net::HttpResponseHeaders* response_headers = request->response_headers(); | 664 net::HttpResponseHeaders* response_headers = request->response_headers(); |
| 665 if (response_headers->HasHeader("x-frame-options")) | 665 if (response_headers && response_headers->HasHeader("x-frame-options")) |
| 666 response_headers->RemoveHeader("x-frame-options"); | 666 response_headers->RemoveHeader("x-frame-options"); |
| 667 } | 667 } |
| 668 | 668 |
| 669 prerender::URLRequestResponseStarted(request); | 669 prerender::URLRequestResponseStarted(request); |
| 670 } | 670 } |
| 671 | 671 |
| 672 void ChromeResourceDispatcherHostDelegate::OnRequestRedirected( | 672 void ChromeResourceDispatcherHostDelegate::OnRequestRedirected( |
| 673 const GURL& redirect_url, | 673 const GURL& redirect_url, |
| 674 net::URLRequest* request, | 674 net::URLRequest* request, |
| 675 content::ResourceContext* resource_context, | 675 content::ResourceContext* resource_context, |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 716 url_request->GetTotalReceivedBytes())); | 716 url_request->GetTotalReceivedBytes())); |
| 717 } | 717 } |
| 718 } | 718 } |
| 719 | 719 |
| 720 // static | 720 // static |
| 721 void ChromeResourceDispatcherHostDelegate:: | 721 void ChromeResourceDispatcherHostDelegate:: |
| 722 SetExternalProtocolHandlerDelegateForTesting( | 722 SetExternalProtocolHandlerDelegateForTesting( |
| 723 ExternalProtocolHandler::Delegate* delegate) { | 723 ExternalProtocolHandler::Delegate* delegate) { |
| 724 g_external_protocol_handler_delegate = delegate; | 724 g_external_protocol_handler_delegate = delegate; |
| 725 } | 725 } |
| OLD | NEW |