| 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 14 matching lines...) Expand all Loading... |
| 25 #include "chrome/browser/prerender/prerender_manager_factory.h" | 25 #include "chrome/browser/prerender/prerender_manager_factory.h" |
| 26 #include "chrome/browser/prerender/prerender_pending_swap_throttle.h" | 26 #include "chrome/browser/prerender/prerender_pending_swap_throttle.h" |
| 27 #include "chrome/browser/prerender/prerender_resource_throttle.h" | 27 #include "chrome/browser/prerender/prerender_resource_throttle.h" |
| 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/safe_browsing_resource_throttle_factory.h
" | 32 #include "chrome/browser/renderer_host/safe_browsing_resource_throttle_factory.h
" |
| 33 #include "chrome/browser/safe_browsing/safe_browsing_service.h" | 33 #include "chrome/browser/safe_browsing/safe_browsing_service.h" |
| 34 #include "chrome/browser/signin/signin_header_helper.h" | 34 #include "chrome/browser/signin/signin_header_helper.h" |
| 35 #include "chrome/browser/ui/auto_login_prompter.h" | |
| 36 #include "chrome/browser/ui/login/login_prompt.h" | 35 #include "chrome/browser/ui/login/login_prompt.h" |
| 37 #include "chrome/browser/ui/sync/one_click_signin_helper.h" | 36 #include "chrome/browser/ui/sync/one_click_signin_helper.h" |
| 38 #include "chrome/common/extensions/extension_constants.h" | 37 #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 "chrome/common/url_constants.h" | 40 #include "chrome/common/url_constants.h" |
| 42 #include "content/public/browser/browser_thread.h" | 41 #include "content/public/browser/browser_thread.h" |
| 43 #include "content/public/browser/notification_service.h" | 42 #include "content/public/browser/notification_service.h" |
| 44 #include "content/public/browser/render_process_host.h" | 43 #include "content/public/browser/render_process_host.h" |
| 45 #include "content/public/browser/render_view_host.h" | 44 #include "content/public/browser/render_view_host.h" |
| (...skipping 21 matching lines...) Expand all Loading... |
| 67 #endif | 66 #endif |
| 68 | 67 |
| 69 #if defined(USE_SYSTEM_PROTOBUF) | 68 #if defined(USE_SYSTEM_PROTOBUF) |
| 70 #include <google/protobuf/repeated_field.h> | 69 #include <google/protobuf/repeated_field.h> |
| 71 #else | 70 #else |
| 72 #include "third_party/protobuf/src/google/protobuf/repeated_field.h" | 71 #include "third_party/protobuf/src/google/protobuf/repeated_field.h" |
| 73 #endif | 72 #endif |
| 74 | 73 |
| 75 #if defined(OS_ANDROID) | 74 #if defined(OS_ANDROID) |
| 76 #include "chrome/browser/android/intercept_download_resource_throttle.h" | 75 #include "chrome/browser/android/intercept_download_resource_throttle.h" |
| 76 #include "chrome/browser/ui/android/infobars/auto_login_prompter.h" |
| 77 #include "components/navigation_interception/intercept_navigation_delegate.h" | 77 #include "components/navigation_interception/intercept_navigation_delegate.h" |
| 78 #else | 78 #else |
| 79 #include "chrome/browser/apps/app_url_redirector.h" | 79 #include "chrome/browser/apps/app_url_redirector.h" |
| 80 #include "chrome/browser/apps/ephemeral_app_throttle.h" | 80 #include "chrome/browser/apps/ephemeral_app_throttle.h" |
| 81 #endif | 81 #endif |
| 82 | 82 |
| 83 #if defined(OS_CHROMEOS) | 83 #if defined(OS_CHROMEOS) |
| 84 #include "chrome/browser/chromeos/login/merge_session_throttle.h" | 84 #include "chrome/browser/chromeos/login/merge_session_throttle.h" |
| 85 // TODO(oshima): Enable this for other platforms. | 85 // TODO(oshima): Enable this for other platforms. |
| 86 #include "chrome/browser/renderer_host/offline_resource_throttle.h" | 86 #include "chrome/browser/renderer_host/offline_resource_throttle.h" |
| (...skipping 515 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 602 #endif | 602 #endif |
| 603 } | 603 } |
| 604 | 604 |
| 605 void ChromeResourceDispatcherHostDelegate::OnResponseStarted( | 605 void ChromeResourceDispatcherHostDelegate::OnResponseStarted( |
| 606 net::URLRequest* request, | 606 net::URLRequest* request, |
| 607 content::ResourceContext* resource_context, | 607 content::ResourceContext* resource_context, |
| 608 content::ResourceResponse* response, | 608 content::ResourceResponse* response, |
| 609 IPC::Sender* sender) { | 609 IPC::Sender* sender) { |
| 610 const ResourceRequestInfo* info = ResourceRequestInfo::ForRequest(request); | 610 const ResourceRequestInfo* info = ResourceRequestInfo::ForRequest(request); |
| 611 | 611 |
| 612 #if defined(OS_ANDROID) |
| 612 // See if the response contains the X-Auto-Login header. If so, this was | 613 // See if the response contains the X-Auto-Login header. If so, this was |
| 613 // a request for a login page, and the server is allowing the browser to | 614 // a request for a login page, and the server is allowing the browser to |
| 614 // suggest auto-login, if available. | 615 // suggest auto-login, if available. |
| 615 AutoLoginPrompter::ShowInfoBarIfPossible(request, info->GetChildID(), | 616 AutoLoginPrompter::ShowInfoBarIfPossible(request, info->GetChildID(), |
| 616 info->GetRouteID()); | 617 info->GetRouteID()); |
| 618 #endif |
| 617 | 619 |
| 618 ProfileIOData* io_data = ProfileIOData::FromResourceContext(resource_context); | 620 ProfileIOData* io_data = ProfileIOData::FromResourceContext(resource_context); |
| 619 | 621 |
| 620 #if defined(ENABLE_ONE_CLICK_SIGNIN) | 622 #if defined(ENABLE_ONE_CLICK_SIGNIN) |
| 621 // See if the response contains the Google-Accounts-SignIn header. If so, | 623 // See if the response contains the Google-Accounts-SignIn header. If so, |
| 622 // then the user has just finished signing in, and the server is allowing the | 624 // then the user has just finished signing in, and the server is allowing the |
| 623 // browser to suggest connecting the user's profile to the account. | 625 // browser to suggest connecting the user's profile to the account. |
| 624 OneClickSigninHelper::ShowInfoBarIfPossible(request, io_data, | 626 OneClickSigninHelper::ShowInfoBarIfPossible(request, io_data, |
| 625 info->GetChildID(), | 627 info->GetChildID(), |
| 626 info->GetRouteID()); | 628 info->GetRouteID()); |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 697 url_request->GetTotalReceivedBytes())); | 699 url_request->GetTotalReceivedBytes())); |
| 698 } | 700 } |
| 699 } | 701 } |
| 700 | 702 |
| 701 // static | 703 // static |
| 702 void ChromeResourceDispatcherHostDelegate:: | 704 void ChromeResourceDispatcherHostDelegate:: |
| 703 SetExternalProtocolHandlerDelegateForTesting( | 705 SetExternalProtocolHandlerDelegateForTesting( |
| 704 ExternalProtocolHandler::Delegate* delegate) { | 706 ExternalProtocolHandler::Delegate* delegate) { |
| 705 g_external_protocol_handler_delegate = delegate; | 707 g_external_protocol_handler_delegate = delegate; |
| 706 } | 708 } |
| OLD | NEW |