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