| 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 15 matching lines...) Expand all Loading... |
| 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/tab_contents/tab_util.h" | 35 #include "chrome/browser/tab_contents/tab_util.h" |
| 36 #include "chrome/browser/ui/auto_login_prompter.h" | |
| 37 #include "chrome/browser/ui/login/login_prompt.h" | 36 #include "chrome/browser/ui/login/login_prompt.h" |
| 38 #include "chrome/browser/ui/sync/one_click_signin_helper.h" | 37 #include "chrome/browser/ui/sync/one_click_signin_helper.h" |
| 39 #include "chrome/common/extensions/extension_constants.h" | 38 #include "chrome/common/extensions/extension_constants.h" |
| 40 #include "chrome/common/extensions/mime_types_handler.h" | 39 #include "chrome/common/extensions/mime_types_handler.h" |
| 41 #include "chrome/common/render_messages.h" | 40 #include "chrome/common/render_messages.h" |
| 42 #include "chrome/common/url_constants.h" | 41 #include "chrome/common/url_constants.h" |
| 43 #include "content/public/browser/browser_thread.h" | 42 #include "content/public/browser/browser_thread.h" |
| 44 #include "content/public/browser/notification_service.h" | 43 #include "content/public/browser/notification_service.h" |
| 45 #include "content/public/browser/render_process_host.h" | 44 #include "content/public/browser/render_process_host.h" |
| 46 #include "content/public/browser/render_view_host.h" | 45 #include "content/public/browser/render_view_host.h" |
| (...skipping 21 matching lines...) Expand all Loading... |
| 68 #endif | 67 #endif |
| 69 | 68 |
| 70 #if defined(USE_SYSTEM_PROTOBUF) | 69 #if defined(USE_SYSTEM_PROTOBUF) |
| 71 #include <google/protobuf/repeated_field.h> | 70 #include <google/protobuf/repeated_field.h> |
| 72 #else | 71 #else |
| 73 #include "third_party/protobuf/src/google/protobuf/repeated_field.h" | 72 #include "third_party/protobuf/src/google/protobuf/repeated_field.h" |
| 74 #endif | 73 #endif |
| 75 | 74 |
| 76 #if defined(OS_ANDROID) | 75 #if defined(OS_ANDROID) |
| 77 #include "chrome/browser/android/intercept_download_resource_throttle.h" | 76 #include "chrome/browser/android/intercept_download_resource_throttle.h" |
| 77 #include "chrome/browser/ui/android/infobars/auto_login_prompter.h" |
| 78 #include "components/navigation_interception/intercept_navigation_delegate.h" | 78 #include "components/navigation_interception/intercept_navigation_delegate.h" |
| 79 #else | 79 #else |
| 80 #include "chrome/browser/apps/app_url_redirector.h" | 80 #include "chrome/browser/apps/app_url_redirector.h" |
| 81 #include "chrome/browser/apps/ephemeral_app_throttle.h" | 81 #include "chrome/browser/apps/ephemeral_app_throttle.h" |
| 82 #endif | 82 #endif |
| 83 | 83 |
| 84 #if defined(OS_CHROMEOS) | 84 #if defined(OS_CHROMEOS) |
| 85 #include "chrome/browser/chromeos/login/merge_session_throttle.h" | 85 #include "chrome/browser/chromeos/login/merge_session_throttle.h" |
| 86 // TODO(oshima): Enable this for other platforms. | 86 // TODO(oshima): Enable this for other platforms. |
| 87 #include "chrome/browser/renderer_host/offline_resource_throttle.h" | 87 #include "chrome/browser/renderer_host/offline_resource_throttle.h" |
| (...skipping 499 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 587 #endif | 587 #endif |
| 588 } | 588 } |
| 589 | 589 |
| 590 void ChromeResourceDispatcherHostDelegate::OnResponseStarted( | 590 void ChromeResourceDispatcherHostDelegate::OnResponseStarted( |
| 591 net::URLRequest* request, | 591 net::URLRequest* request, |
| 592 content::ResourceContext* resource_context, | 592 content::ResourceContext* resource_context, |
| 593 content::ResourceResponse* response, | 593 content::ResourceResponse* response, |
| 594 IPC::Sender* sender) { | 594 IPC::Sender* sender) { |
| 595 const ResourceRequestInfo* info = ResourceRequestInfo::ForRequest(request); | 595 const ResourceRequestInfo* info = ResourceRequestInfo::ForRequest(request); |
| 596 | 596 |
| 597 #if defined(OS_ANDROID) |
| 597 // See if the response contains the X-Auto-Login header. If so, this was | 598 // See if the response contains the X-Auto-Login header. If so, this was |
| 598 // a request for a login page, and the server is allowing the browser to | 599 // a request for a login page, and the server is allowing the browser to |
| 599 // suggest auto-login, if available. | 600 // suggest auto-login, if available. |
| 600 AutoLoginPrompter::ShowInfoBarIfPossible(request, info->GetChildID(), | 601 AutoLoginPrompter::ShowInfoBarIfPossible(request, info->GetChildID(), |
| 601 info->GetRouteID()); | 602 info->GetRouteID()); |
| 603 #endif |
| 602 | 604 |
| 603 ProfileIOData* io_data = ProfileIOData::FromResourceContext(resource_context); | 605 ProfileIOData* io_data = ProfileIOData::FromResourceContext(resource_context); |
| 604 | 606 |
| 605 #if defined(ENABLE_ONE_CLICK_SIGNIN) | 607 #if defined(ENABLE_ONE_CLICK_SIGNIN) |
| 606 // See if the response contains the Google-Accounts-SignIn header. If so, | 608 // See if the response contains the Google-Accounts-SignIn header. If so, |
| 607 // then the user has just finished signing in, and the server is allowing the | 609 // then the user has just finished signing in, and the server is allowing the |
| 608 // browser to suggest connecting the user's profile to the account. | 610 // browser to suggest connecting the user's profile to the account. |
| 609 OneClickSigninHelper::ShowInfoBarIfPossible(request, io_data, | 611 OneClickSigninHelper::ShowInfoBarIfPossible(request, io_data, |
| 610 info->GetChildID(), | 612 info->GetChildID(), |
| 611 info->GetRouteID()); | 613 info->GetRouteID()); |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 682 url_request->GetTotalReceivedBytes())); | 684 url_request->GetTotalReceivedBytes())); |
| 683 } | 685 } |
| 684 } | 686 } |
| 685 | 687 |
| 686 // static | 688 // static |
| 687 void ChromeResourceDispatcherHostDelegate:: | 689 void ChromeResourceDispatcherHostDelegate:: |
| 688 SetExternalProtocolHandlerDelegateForTesting( | 690 SetExternalProtocolHandlerDelegateForTesting( |
| 689 ExternalProtocolHandler::Delegate* delegate) { | 691 ExternalProtocolHandler::Delegate* delegate) { |
| 690 g_external_protocol_handler_delegate = delegate; | 692 g_external_protocol_handler_delegate = delegate; |
| 691 } | 693 } |
| OLD | NEW |