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> |
| 8 |
7 #include "base/logging.h" | 9 #include "base/logging.h" |
8 #include "chrome/browser/browser_process.h" | 10 #include "chrome/browser/browser_process.h" |
9 #include "chrome/browser/content_settings/host_content_settings_map.h" | 11 #include "chrome/browser/content_settings/host_content_settings_map.h" |
10 #include "chrome/browser/download/download_request_limiter.h" | 12 #include "chrome/browser/download/download_request_limiter.h" |
11 #include "chrome/browser/download/download_resource_throttle.h" | 13 #include "chrome/browser/download/download_resource_throttle.h" |
12 #include "chrome/browser/download/download_util.h" | 14 #include "chrome/browser/download/download_util.h" |
13 #include "chrome/browser/extensions/user_script_listener.h" | 15 #include "chrome/browser/extensions/user_script_listener.h" |
14 #include "chrome/browser/external_protocol/external_protocol_handler.h" | 16 #include "chrome/browser/external_protocol/external_protocol_handler.h" |
15 #include "chrome/browser/instant/instant_loader.h" | 17 #include "chrome/browser/instant/instant_loader.h" |
16 #include "chrome/browser/net/load_timing_observer.h" | 18 #include "chrome/browser/net/load_timing_observer.h" |
(...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
308 const ResourceRequestInfo* info = ResourceRequestInfo::ForRequest(request); | 310 const ResourceRequestInfo* info = ResourceRequestInfo::ForRequest(request); |
309 | 311 |
310 if (request->url().SchemeIsSecure()) { | 312 if (request->url().SchemeIsSecure()) { |
311 const net::URLRequestContext* context = request->context(); | 313 const net::URLRequestContext* context = request->context(); |
312 net::TransportSecurityState* state = context->transport_security_state(); | 314 net::TransportSecurityState* state = context->transport_security_state(); |
313 if (state) { | 315 if (state) { |
314 net::TransportSecurityState::DomainState domain_state; | 316 net::TransportSecurityState::DomainState domain_state; |
315 bool has_sni = net::SSLConfigService::IsSNIAvailable( | 317 bool has_sni = net::SSLConfigService::IsSNIAvailable( |
316 context->ssl_config_service()); | 318 context->ssl_config_service()); |
317 if (state->GetDomainState( | 319 if (state->GetDomainState( |
318 &domain_state, request->url().host(), has_sni)) { | 320 request->url().host(), has_sni, &domain_state)) { |
319 sender->Send(new ChromeViewMsg_AddStrictSecurityHost( | 321 sender->Send(new ChromeViewMsg_AddStrictSecurityHost( |
320 info->GetRouteID(), request->url().host())); | 322 info->GetRouteID(), request->url().host())); |
321 } | 323 } |
322 } | 324 } |
323 } | 325 } |
324 | 326 |
325 // See if the response contains the X-Auto-Login header. If so, this was | 327 // See if the response contains the X-Auto-Login header. If so, this was |
326 // a request for a login page, and the server is allowing the browser to | 328 // a request for a login page, and the server is allowing the browser to |
327 // suggest auto-login, if available. | 329 // suggest auto-login, if available. |
328 AutoLoginPrompter::ShowInfoBarIfPossible(request, info->GetChildID(), | 330 AutoLoginPrompter::ShowInfoBarIfPossible(request, info->GetChildID(), |
329 info->GetRouteID()); | 331 info->GetRouteID()); |
330 } | 332 } |
331 | 333 |
332 void ChromeResourceDispatcherHostDelegate::OnRequestRedirected( | 334 void ChromeResourceDispatcherHostDelegate::OnRequestRedirected( |
333 net::URLRequest* request, | 335 net::URLRequest* request, |
334 content::ResourceResponse* response) { | 336 content::ResourceResponse* response) { |
335 LoadTimingObserver::PopulateTimingInfo(request, response); | 337 LoadTimingObserver::PopulateTimingInfo(request, response); |
336 | 338 |
337 #if defined(ENABLE_ONE_CLICK_SIGNIN) | 339 #if defined(ENABLE_ONE_CLICK_SIGNIN) |
338 const ResourceRequestInfo* info = ResourceRequestInfo::ForRequest(request); | 340 const ResourceRequestInfo* info = ResourceRequestInfo::ForRequest(request); |
339 | 341 |
340 // See if the response contains the Google-Accounts-SignIn header. If so, | 342 // See if the response contains the Google-Accounts-SignIn header. If so, |
341 // then the user has just finished signing in, and the server is allowing the | 343 // then the user has just finished signing in, and the server is allowing the |
342 // browser to suggest connecting the user's profile to the account. | 344 // browser to suggest connecting the user's profile to the account. |
343 OneClickSigninHelper::ShowInfoBarIfPossible(request, info->GetChildID(), | 345 OneClickSigninHelper::ShowInfoBarIfPossible(request, info->GetChildID(), |
344 info->GetRouteID()); | 346 info->GetRouteID()); |
345 #endif | 347 #endif |
346 } | 348 } |
OLD | NEW |