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

Side by Side Diff: chrome/browser/content_settings/tab_specific_content_settings.cc

Issue 7831075: Delegating the "are images allowed" decision to renderer. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Transmit image settings to the renderer. Draft. Created 9 years, 3 months 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/content_settings/tab_specific_content_settings.h" 5 #include "chrome/browser/content_settings/tab_specific_content_settings.h"
6 6
7 #include <list> 7 #include <list>
8 8
9 #include "base/lazy_instance.h" 9 #include "base/lazy_instance.h"
10 #include "base/utf_string_conversions.h" 10 #include "base/utf_string_conversions.h"
(...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after
412 } 412 }
413 } 413 }
414 414
415 void TabSpecificContentSettings::RenderViewCreated( 415 void TabSpecificContentSettings::RenderViewCreated(
416 RenderViewHost* render_view_host) { 416 RenderViewHost* render_view_host) {
417 Profile* profile = 417 Profile* profile =
418 Profile::FromBrowserContext(tab_contents()->browser_context()); 418 Profile::FromBrowserContext(tab_contents()->browser_context());
419 HostContentSettingsMap* map = profile->GetHostContentSettingsMap(); 419 HostContentSettingsMap* map = profile->GetHostContentSettingsMap();
420 render_view_host->Send(new ChromeViewMsg_SetDefaultContentSettings( 420 render_view_host->Send(new ChromeViewMsg_SetDefaultContentSettings(
421 map->GetDefaultContentSettings())); 421 map->GetDefaultContentSettings()));
422
423 ContentSettingRules rules;
424 map->GetConcatenatedSettingsForOneType(CONTENT_SETTINGS_TYPE_IMAGES, "",
425 &rules);
426 render_view_host->Send(new ChromeViewMsg_SetImageSettings(rules));
422 } 427 }
423 428
424 void TabSpecificContentSettings::DidStartProvisionalLoadForFrame( 429 void TabSpecificContentSettings::DidStartProvisionalLoadForFrame(
425 int64 frame_id, 430 int64 frame_id,
426 bool is_main_frame, 431 bool is_main_frame,
427 const GURL& validated_url, 432 const GURL& validated_url,
428 bool is_error_page, 433 bool is_error_page,
429 RenderViewHost* render_view_host) { 434 RenderViewHost* render_view_host) {
430 if (!is_main_frame) 435 if (!is_main_frame)
431 return; 436 return;
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
464 // The active NavigationEntry is the URL in the URL field of a tab. 469 // The active NavigationEntry is the URL in the URL field of a tab.
465 // Currently this should be matched by the |primary_pattern|. 470 // Currently this should be matched by the |primary_pattern|.
466 settings_details.ptr()->primary_pattern().Matches(entry_url)) { 471 settings_details.ptr()->primary_pattern().Matches(entry_url)) {
467 Profile* profile = 472 Profile* profile =
468 Profile::FromBrowserContext(tab_contents()->browser_context()); 473 Profile::FromBrowserContext(tab_contents()->browser_context());
469 HostContentSettingsMap* map = profile->GetHostContentSettingsMap(); 474 HostContentSettingsMap* map = profile->GetHostContentSettingsMap();
470 Send(new ChromeViewMsg_SetDefaultContentSettings( 475 Send(new ChromeViewMsg_SetDefaultContentSettings(
471 map->GetDefaultContentSettings())); 476 map->GetDefaultContentSettings()));
472 Send(new ChromeViewMsg_SetContentSettingsForCurrentURL( 477 Send(new ChromeViewMsg_SetContentSettingsForCurrentURL(
473 entry_url, map->GetContentSettings(entry_url, entry_url))); 478 entry_url, map->GetContentSettings(entry_url, entry_url)));
479 ContentSettingRules rules;
480 map->GetConcatenatedSettingsForOneType(CONTENT_SETTINGS_TYPE_IMAGES, "",
481 &rules);
482 Send(new ChromeViewMsg_SetImageSettings(rules));
474 } 483 }
475 } 484 }
476 485
477 TabSpecificContentSettings::LocalSharedObjectsContainer:: 486 TabSpecificContentSettings::LocalSharedObjectsContainer::
478 LocalSharedObjectsContainer(Profile* profile) 487 LocalSharedObjectsContainer(Profile* profile)
479 : appcaches_(new CannedBrowsingDataAppCacheHelper(profile)), 488 : appcaches_(new CannedBrowsingDataAppCacheHelper(profile)),
480 cookies_(new CannedBrowsingDataCookieHelper(profile)), 489 cookies_(new CannedBrowsingDataCookieHelper(profile)),
481 databases_(new CannedBrowsingDataDatabaseHelper(profile)), 490 databases_(new CannedBrowsingDataDatabaseHelper(profile)),
482 file_systems_(new CannedBrowsingDataFileSystemHelper(profile)), 491 file_systems_(new CannedBrowsingDataFileSystemHelper(profile)),
483 indexed_dbs_(new CannedBrowsingDataIndexedDBHelper()), 492 indexed_dbs_(new CannedBrowsingDataIndexedDBHelper()),
(...skipping 20 matching lines...) Expand all
504 return new CookiesTreeModel(cookies_->Clone(), 513 return new CookiesTreeModel(cookies_->Clone(),
505 databases_->Clone(), 514 databases_->Clone(),
506 local_storages_->Clone(), 515 local_storages_->Clone(),
507 session_storages_->Clone(), 516 session_storages_->Clone(),
508 appcaches_->Clone(), 517 appcaches_->Clone(),
509 indexed_dbs_->Clone(), 518 indexed_dbs_->Clone(),
510 file_systems_->Clone(), 519 file_systems_->Clone(),
511 NULL, 520 NULL,
512 true); 521 true);
513 } 522 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698