| 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 "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "chrome/browser/browser_process.h" | 8 #include "chrome/browser/browser_process.h" |
| 9 #include "chrome/browser/content_settings/host_content_settings_map.h" | 9 #include "chrome/browser/content_settings/host_content_settings_map.h" |
| 10 #include "chrome/browser/download/download_request_limiter.h" | 10 #include "chrome/browser/download/download_request_limiter.h" |
| 11 #include "chrome/browser/download/download_resource_throttle.h" | 11 #include "chrome/browser/download/download_resource_throttle.h" |
| 12 #include "chrome/browser/download/download_util.h" | 12 #include "chrome/browser/download/download_util.h" |
| 13 #include "chrome/browser/extensions/user_script_listener.h" | 13 #include "chrome/browser/extensions/user_script_listener.h" |
| 14 #include "chrome/browser/external_protocol/external_protocol_handler.h" | 14 #include "chrome/browser/external_protocol/external_protocol_handler.h" |
| 15 #include "chrome/browser/instant/instant_loader.h" | 15 #include "chrome/browser/instant/instant_loader.h" |
| 16 #include "chrome/browser/net/load_timing_observer.h" | 16 #include "chrome/browser/net/load_timing_observer.h" |
| 17 #include "chrome/browser/prerender/prerender_manager.h" | 17 #include "chrome/browser/prerender/prerender_manager.h" |
| 18 #include "chrome/browser/prerender/prerender_manager_factory.h" | 18 #include "chrome/browser/prerender/prerender_manager_factory.h" |
| 19 #include "chrome/browser/prerender/prerender_resource_throttle.h" | 19 #include "chrome/browser/prerender/prerender_resource_throttle.h" |
| 20 #include "chrome/browser/prerender/prerender_tracker.h" | 20 #include "chrome/browser/prerender/prerender_tracker.h" |
| 21 #include "chrome/browser/profiles/profile_io_data.h" | 21 #include "chrome/browser/profiles/profile_io_data.h" |
| 22 #include "chrome/browser/renderer_host/chrome_url_request_user_data.h" | 22 #include "chrome/browser/renderer_host/chrome_url_request_user_data.h" |
| 23 #include "chrome/browser/renderer_host/safe_browsing_resource_throttle.h" | 23 #include "chrome/browser/renderer_host/safe_browsing_resource_throttle.h" |
| 24 #include "chrome/browser/renderer_host/transfer_navigation_resource_throttle.h" | 24 #include "chrome/browser/renderer_host/transfer_navigation_resource_throttle.h" |
| 25 #include "chrome/browser/safe_browsing/safe_browsing_service.h" | 25 #include "chrome/browser/safe_browsing/safe_browsing_service.h" |
| 26 #include "chrome/browser/signin/one_click_signin.h" |
| 26 #include "chrome/browser/ui/auto_login_prompter.h" | 27 #include "chrome/browser/ui/auto_login_prompter.h" |
| 27 #include "chrome/browser/ui/login/login_prompt.h" | 28 #include "chrome/browser/ui/login/login_prompt.h" |
| 28 #include "chrome/common/chrome_notification_types.h" | 29 #include "chrome/common/chrome_notification_types.h" |
| 29 #include "chrome/common/extensions/user_script.h" | 30 #include "chrome/common/extensions/user_script.h" |
| 30 #include "chrome/common/render_messages.h" | 31 #include "chrome/common/render_messages.h" |
| 31 #include "content/browser/renderer_host/render_view_host.h" | 32 #include "content/browser/renderer_host/render_view_host.h" |
| 32 #include "content/browser/renderer_host/resource_dispatcher_host.h" | 33 #include "content/browser/renderer_host/resource_dispatcher_host.h" |
| 33 #include "content/browser/renderer_host/resource_dispatcher_host_request_info.h" | 34 #include "content/browser/renderer_host/resource_dispatcher_host_request_info.h" |
| 34 #include "content/public/browser/browser_thread.h" | 35 #include "content/public/browser/browser_thread.h" |
| 35 #include "content/public/browser/notification_service.h" | 36 #include "content/public/browser/notification_service.h" |
| (...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 331 // a request for a login page, and the server is allowing the browser to | 332 // a request for a login page, and the server is allowing the browser to |
| 332 // suggest auto-login, if available. | 333 // suggest auto-login, if available. |
| 333 AutoLoginPrompter::ShowInfoBarIfPossible(request, info->child_id(), | 334 AutoLoginPrompter::ShowInfoBarIfPossible(request, info->child_id(), |
| 334 info->route_id()); | 335 info->route_id()); |
| 335 } | 336 } |
| 336 | 337 |
| 337 void ChromeResourceDispatcherHostDelegate::OnRequestRedirected( | 338 void ChromeResourceDispatcherHostDelegate::OnRequestRedirected( |
| 338 net::URLRequest* request, | 339 net::URLRequest* request, |
| 339 content::ResourceResponse* response) { | 340 content::ResourceResponse* response) { |
| 340 LoadTimingObserver::PopulateTimingInfo(request, response); | 341 LoadTimingObserver::PopulateTimingInfo(request, response); |
| 342 |
| 343 #if defined(ENABLE_ONE_CLICK_SIGNIN) |
| 344 ResourceDispatcherHostRequestInfo* info = |
| 345 resource_dispatcher_host_->InfoForRequest(request); |
| 346 |
| 347 // See if the response contains the X-Google-Accounts-SignIn header. If so, |
| 348 // then the user has just finished signing in, and the server is allowing the |
| 349 // browser to suggest connecting the user's profile to the account. |
| 350 OneClickSigninManager::ShowInfoBarIfPossible(request, info->child_id(), |
| 351 info->route_id()); |
| 352 #endif |
| 341 } | 353 } |
| OLD | NEW |