| 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 17 matching lines...) Expand all Loading... |
| 28 #include "chrome/browser/prerender/prerender_tracker.h" | 28 #include "chrome/browser/prerender/prerender_tracker.h" |
| 29 #include "chrome/browser/prerender/prerender_util.h" | 29 #include "chrome/browser/prerender/prerender_util.h" |
| 30 #include "chrome/browser/profiles/profile.h" | 30 #include "chrome/browser/profiles/profile.h" |
| 31 #include "chrome/browser/profiles/profile_io_data.h" | 31 #include "chrome/browser/profiles/profile_io_data.h" |
| 32 #include "chrome/browser/renderer_host/chrome_url_request_user_data.h" | 32 #include "chrome/browser/renderer_host/chrome_url_request_user_data.h" |
| 33 #include "chrome/browser/renderer_host/safe_browsing_resource_throttle_factory.h
" | 33 #include "chrome/browser/renderer_host/safe_browsing_resource_throttle_factory.h
" |
| 34 #include "chrome/browser/safe_browsing/safe_browsing_service.h" | 34 #include "chrome/browser/safe_browsing/safe_browsing_service.h" |
| 35 #include "chrome/browser/ui/auto_login_prompter.h" | 35 #include "chrome/browser/ui/auto_login_prompter.h" |
| 36 #include "chrome/browser/ui/login/login_prompt.h" | 36 #include "chrome/browser/ui/login/login_prompt.h" |
| 37 #include "chrome/browser/ui/sync/one_click_signin_helper.h" | 37 #include "chrome/browser/ui/sync/one_click_signin_helper.h" |
| 38 #include "chrome/common/extensions/extension_constants.h" | |
| 39 #include "chrome/common/extensions/mime_types_handler.h" | 38 #include "chrome/common/extensions/mime_types_handler.h" |
| 40 #include "chrome/common/render_messages.h" | 39 #include "chrome/common/render_messages.h" |
| 41 #include "content/public/browser/browser_thread.h" | 40 #include "content/public/browser/browser_thread.h" |
| 42 #include "content/public/browser/notification_service.h" | 41 #include "content/public/browser/notification_service.h" |
| 43 #include "content/public/browser/render_process_host.h" | 42 #include "content/public/browser/render_process_host.h" |
| 44 #include "content/public/browser/render_view_host.h" | 43 #include "content/public/browser/render_view_host.h" |
| 45 #include "content/public/browser/resource_context.h" | 44 #include "content/public/browser/resource_context.h" |
| 46 #include "content/public/browser/resource_dispatcher_host.h" | 45 #include "content/public/browser/resource_dispatcher_host.h" |
| 47 #include "content/public/browser/resource_request_info.h" | 46 #include "content/public/browser/resource_request_info.h" |
| 48 #include "content/public/browser/stream_handle.h" | 47 #include "content/public/browser/stream_handle.h" |
| 49 #include "content/public/common/resource_response.h" | 48 #include "content/public/common/resource_response.h" |
| 50 #include "extensions/common/constants.h" | 49 #include "extensions/common/constants.h" |
| 50 #include "extensions/common/extension_urls.h" |
| 51 #include "extensions/common/user_script.h" | 51 #include "extensions/common/user_script.h" |
| 52 #include "net/base/load_flags.h" | 52 #include "net/base/load_flags.h" |
| 53 #include "net/base/load_timing_info.h" | 53 #include "net/base/load_timing_info.h" |
| 54 #include "net/base/request_priority.h" | 54 #include "net/base/request_priority.h" |
| 55 #include "net/http/http_response_headers.h" | 55 #include "net/http/http_response_headers.h" |
| 56 #include "net/ssl/ssl_config_service.h" | 56 #include "net/ssl/ssl_config_service.h" |
| 57 #include "net/url_request/url_request.h" | 57 #include "net/url_request/url_request.h" |
| 58 | 58 |
| 59 #if defined(ENABLE_MANAGED_USERS) | 59 #if defined(ENABLE_MANAGED_USERS) |
| 60 #include "chrome/browser/managed_mode/managed_mode_resource_throttle.h" | 60 #include "chrome/browser/managed_mode/managed_mode_resource_throttle.h" |
| (...skipping 599 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 660 #if defined(ENABLE_ONE_CLICK_SIGNIN) | 660 #if defined(ENABLE_ONE_CLICK_SIGNIN) |
| 661 // See if the response contains the Google-Accounts-SignIn header. If so, | 661 // See if the response contains the Google-Accounts-SignIn header. If so, |
| 662 // then the user has just finished signing in, and the server is allowing the | 662 // then the user has just finished signing in, and the server is allowing the |
| 663 // browser to suggest connecting the user's profile to the account. | 663 // browser to suggest connecting the user's profile to the account. |
| 664 OneClickSigninHelper::ShowInfoBarIfPossible(request, io_data, | 664 OneClickSigninHelper::ShowInfoBarIfPossible(request, io_data, |
| 665 info->GetChildID(), | 665 info->GetChildID(), |
| 666 info->GetRouteID()); | 666 info->GetRouteID()); |
| 667 #endif | 667 #endif |
| 668 | 668 |
| 669 // Build in additional protection for the chrome web store origin. | 669 // Build in additional protection for the chrome web store origin. |
| 670 GURL webstore_url(extension_urls::GetWebstoreLaunchURL()); | 670 GURL webstore_url(extensions::GetWebstoreLaunchURL()); |
| 671 if (request->url().DomainIs(webstore_url.host().c_str())) { | 671 if (request->url().DomainIs(webstore_url.host().c_str())) { |
| 672 net::HttpResponseHeaders* response_headers = request->response_headers(); | 672 net::HttpResponseHeaders* response_headers = request->response_headers(); |
| 673 if (!response_headers->HasHeaderValue("x-frame-options", "deny") && | 673 if (!response_headers->HasHeaderValue("x-frame-options", "deny") && |
| 674 !response_headers->HasHeaderValue("x-frame-options", "sameorigin")) { | 674 !response_headers->HasHeaderValue("x-frame-options", "sameorigin")) { |
| 675 response_headers->RemoveHeader("x-frame-options"); | 675 response_headers->RemoveHeader("x-frame-options"); |
| 676 response_headers->AddHeader("x-frame-options: sameorigin"); | 676 response_headers->AddHeader("x-frame-options: sameorigin"); |
| 677 } | 677 } |
| 678 } | 678 } |
| 679 | 679 |
| 680 if (io_data->resource_prefetch_predictor_observer()) | 680 if (io_data->resource_prefetch_predictor_observer()) |
| (...skipping 30 matching lines...) Expand all Loading... |
| 711 if (!prerender::PrerenderManager::DoesURLHaveValidScheme(redirect_url) && | 711 if (!prerender::PrerenderManager::DoesURLHaveValidScheme(redirect_url) && |
| 712 ResourceRequestInfo::ForRequest(request)->GetAssociatedRenderView( | 712 ResourceRequestInfo::ForRequest(request)->GetAssociatedRenderView( |
| 713 &child_id, &route_id) && | 713 &child_id, &route_id) && |
| 714 prerender_tracker_->IsPrerenderingOnIOThread(child_id, route_id) && | 714 prerender_tracker_->IsPrerenderingOnIOThread(child_id, route_id) && |
| 715 prerender_tracker_->TryCancel( | 715 prerender_tracker_->TryCancel( |
| 716 child_id, route_id, prerender::FINAL_STATUS_UNSUPPORTED_SCHEME)) { | 716 child_id, route_id, prerender::FINAL_STATUS_UNSUPPORTED_SCHEME)) { |
| 717 ReportUnsupportedPrerenderScheme(redirect_url); | 717 ReportUnsupportedPrerenderScheme(redirect_url); |
| 718 request->Cancel(); | 718 request->Cancel(); |
| 719 } | 719 } |
| 720 } | 720 } |
| OLD | NEW |