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" |
36 #include "chrome/browser/ui/login/login_prompt.h" | 37 #include "chrome/browser/ui/login/login_prompt.h" |
37 #include "chrome/browser/ui/sync/one_click_signin_helper.h" | 38 #include "chrome/browser/ui/sync/one_click_signin_helper.h" |
38 #include "chrome/common/extensions/extension_constants.h" | 39 #include "chrome/common/extensions/extension_constants.h" |
39 #include "chrome/common/extensions/mime_types_handler.h" | 40 #include "chrome/common/extensions/mime_types_handler.h" |
40 #include "chrome/common/render_messages.h" | 41 #include "chrome/common/render_messages.h" |
41 #include "chrome/common/url_constants.h" | 42 #include "chrome/common/url_constants.h" |
42 #include "content/public/browser/browser_thread.h" | 43 #include "content/public/browser/browser_thread.h" |
43 #include "content/public/browser/notification_service.h" | 44 #include "content/public/browser/notification_service.h" |
44 #include "content/public/browser/render_process_host.h" | 45 #include "content/public/browser/render_process_host.h" |
45 #include "content/public/browser/render_view_host.h" | 46 #include "content/public/browser/render_view_host.h" |
(...skipping 21 matching lines...) Expand all Loading... |
67 #endif | 68 #endif |
68 | 69 |
69 #if defined(USE_SYSTEM_PROTOBUF) | 70 #if defined(USE_SYSTEM_PROTOBUF) |
70 #include <google/protobuf/repeated_field.h> | 71 #include <google/protobuf/repeated_field.h> |
71 #else | 72 #else |
72 #include "third_party/protobuf/src/google/protobuf/repeated_field.h" | 73 #include "third_party/protobuf/src/google/protobuf/repeated_field.h" |
73 #endif | 74 #endif |
74 | 75 |
75 #if defined(OS_ANDROID) | 76 #if defined(OS_ANDROID) |
76 #include "chrome/browser/android/intercept_download_resource_throttle.h" | 77 #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) | |
598 // See if the response contains the X-Auto-Login header. If so, this was | 597 // See if the response contains the X-Auto-Login header. If so, this was |
599 // a request for a login page, and the server is allowing the browser to | 598 // a request for a login page, and the server is allowing the browser to |
600 // suggest auto-login, if available. | 599 // suggest auto-login, if available. |
601 AutoLoginPrompter::ShowInfoBarIfPossible(request, info->GetChildID(), | 600 AutoLoginPrompter::ShowInfoBarIfPossible(request, info->GetChildID(), |
602 info->GetRouteID()); | 601 info->GetRouteID()); |
603 #endif | |
604 | 602 |
605 ProfileIOData* io_data = ProfileIOData::FromResourceContext(resource_context); | 603 ProfileIOData* io_data = ProfileIOData::FromResourceContext(resource_context); |
606 | 604 |
607 #if defined(ENABLE_ONE_CLICK_SIGNIN) | 605 #if defined(ENABLE_ONE_CLICK_SIGNIN) |
608 // See if the response contains the Google-Accounts-SignIn header. If so, | 606 // See if the response contains the Google-Accounts-SignIn header. If so, |
609 // then the user has just finished signing in, and the server is allowing the | 607 // then the user has just finished signing in, and the server is allowing the |
610 // browser to suggest connecting the user's profile to the account. | 608 // browser to suggest connecting the user's profile to the account. |
611 OneClickSigninHelper::ShowInfoBarIfPossible(request, io_data, | 609 OneClickSigninHelper::ShowInfoBarIfPossible(request, io_data, |
612 info->GetChildID(), | 610 info->GetChildID(), |
613 info->GetRouteID()); | 611 info->GetRouteID()); |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
684 url_request->GetTotalReceivedBytes())); | 682 url_request->GetTotalReceivedBytes())); |
685 } | 683 } |
686 } | 684 } |
687 | 685 |
688 // static | 686 // static |
689 void ChromeResourceDispatcherHostDelegate:: | 687 void ChromeResourceDispatcherHostDelegate:: |
690 SetExternalProtocolHandlerDelegateForTesting( | 688 SetExternalProtocolHandlerDelegateForTesting( |
691 ExternalProtocolHandler::Delegate* delegate) { | 689 ExternalProtocolHandler::Delegate* delegate) { |
692 g_external_protocol_handler_delegate = delegate; | 690 g_external_protocol_handler_delegate = delegate; |
693 } | 691 } |
OLD | NEW |