| 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 624 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 635 net::URLRequest* request, | 635 net::URLRequest* request, |
| 636 content::ResourceContext* resource_context, | 636 content::ResourceContext* resource_context, |
| 637 content::ResourceResponse* response, | 637 content::ResourceResponse* response, |
| 638 IPC::Sender* sender) { | 638 IPC::Sender* sender) { |
| 639 const ResourceRequestInfo* info = ResourceRequestInfo::ForRequest(request); | 639 const ResourceRequestInfo* info = ResourceRequestInfo::ForRequest(request); |
| 640 | 640 |
| 641 #if defined(OS_ANDROID) | 641 #if defined(OS_ANDROID) |
| 642 // See if the response contains the X-Auto-Login header. If so, this was | 642 // See if the response contains the X-Auto-Login header. If so, this was |
| 643 // a request for a login page, and the server is allowing the browser to | 643 // a request for a login page, and the server is allowing the browser to |
| 644 // suggest auto-login, if available. | 644 // suggest auto-login, if available. |
| 645 AutoLoginPrompter::ShowInfoBarIfPossible(request, info->GetChildID(), | 645 if (info->IsMainFrame()) { |
| 646 info->GetRouteID()); | 646 AutoLoginPrompter::ShowInfoBarIfPossible(request, info->GetChildID(), |
| 647 info->GetRouteID()); |
| 648 } |
| 647 #endif | 649 #endif |
| 648 | 650 |
| 649 ProfileIOData* io_data = ProfileIOData::FromResourceContext(resource_context); | 651 ProfileIOData* io_data = ProfileIOData::FromResourceContext(resource_context); |
| 650 | 652 |
| 651 #if defined(ENABLE_ONE_CLICK_SIGNIN) | 653 #if defined(ENABLE_ONE_CLICK_SIGNIN) |
| 652 // See if the response contains the Google-Accounts-SignIn header. If so, | 654 // See if the response contains the Google-Accounts-SignIn header. If so, |
| 653 // then the user has just finished signing in, and the server is allowing the | 655 // then the user has just finished signing in, and the server is allowing the |
| 654 // browser to suggest connecting the user's profile to the account. | 656 // browser to suggest connecting the user's profile to the account. |
| 655 OneClickSigninHelper::ShowInfoBarIfPossible(request, io_data, | 657 OneClickSigninHelper::ShowInfoBarIfPossible(request, io_data, |
| 656 info->GetChildID(), | 658 info->GetChildID(), |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 749 url_request->GetTotalReceivedBytes())); | 751 url_request->GetTotalReceivedBytes())); |
| 750 } | 752 } |
| 751 } | 753 } |
| 752 | 754 |
| 753 // static | 755 // static |
| 754 void ChromeResourceDispatcherHostDelegate:: | 756 void ChromeResourceDispatcherHostDelegate:: |
| 755 SetExternalProtocolHandlerDelegateForTesting( | 757 SetExternalProtocolHandlerDelegateForTesting( |
| 756 ExternalProtocolHandler::Delegate* delegate) { | 758 ExternalProtocolHandler::Delegate* delegate) { |
| 757 g_external_protocol_handler_delegate = delegate; | 759 g_external_protocol_handler_delegate = delegate; |
| 758 } | 760 } |
| OLD | NEW |