Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(129)

Side by Side Diff: chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc

Issue 8538004: Take script URLs into account when applying script content settings. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased. Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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"
(...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after
326 if (state->IsEnabledForHost( 326 if (state->IsEnabledForHost(
327 &domain_state, request->url().host(), has_sni) || 327 &domain_state, request->url().host(), has_sni) ||
328 state->HasPinsForHost( 328 state->HasPinsForHost(
329 &domain_state, request->url().host(), has_sni)) { 329 &domain_state, request->url().host(), has_sni)) {
330 filter->Send(new ChromeViewMsg_AddStrictSecurityHost( 330 filter->Send(new ChromeViewMsg_AddStrictSecurityHost(
331 info->route_id(), request->url().host())); 331 info->route_id(), request->url().host()));
332 } 332 }
333 } 333 }
334 } 334 }
335 335
336 // We must send the content settings for the URL before sending response
337 // headers to the renderer.
338 const content::ResourceContext& resource_context = filter->resource_context();
339 ProfileIOData* io_data =
340 reinterpret_cast<ProfileIOData*>(resource_context.GetUserData(NULL));
341 HostContentSettingsMap* map = io_data->GetHostContentSettingsMap();
342 filter->Send(new ChromeViewMsg_SetContentSettingsForLoadingURL(
343 info->route_id(), request->url(),
344 map->GetContentSettings(request->url())));
345
346 // See if the response contains the X-Auto-Login header. If so, this was 336 // See if the response contains the X-Auto-Login header. If so, this was
347 // a request for a login page, and the server is allowing the browser to 337 // a request for a login page, and the server is allowing the browser to
348 // suggest auto-login, if available. 338 // suggest auto-login, if available.
349 AutoLoginPrompter::ShowInfoBarIfPossible(request, info->child_id(), 339 AutoLoginPrompter::ShowInfoBarIfPossible(request, info->child_id(),
350 info->route_id()); 340 info->route_id());
351 } 341 }
352 342
353 void ChromeResourceDispatcherHostDelegate::OnRequestRedirected( 343 void ChromeResourceDispatcherHostDelegate::OnRequestRedirected(
354 net::URLRequest* request, 344 net::URLRequest* request,
355 ResourceResponse* response, 345 ResourceResponse* response,
356 ResourceMessageFilter* filter) { 346 ResourceMessageFilter* filter) {
357 LoadTimingObserver::PopulateTimingInfo(request, response); 347 LoadTimingObserver::PopulateTimingInfo(request, response);
358 } 348 }
OLDNEW
« no previous file with comments | « chrome/browser/content_settings/tab_specific_content_settings.cc ('k') | chrome/common/content_settings.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698