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

Unified Diff: chrome/browser/content_settings/tab_specific_content_settings.cc

Issue 7464009: Removal of Profile from content part 1. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: browser_context Created 9 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/content_settings/tab_specific_content_settings.cc
diff --git a/chrome/browser/content_settings/tab_specific_content_settings.cc b/chrome/browser/content_settings/tab_specific_content_settings.cc
index 4f6d303fc847074a476e210cee9502d69204011d..d27ad23de6b7e23ab4c3e67e2b41ff8797116867 100644
--- a/chrome/browser/content_settings/tab_specific_content_settings.cc
+++ b/chrome/browser/content_settings/tab_specific_content_settings.cc
@@ -47,9 +47,10 @@ bool TabSpecificContentSettings::LocalSharedObjectsContainer::empty() const {
TabSpecificContentSettings::TabSpecificContentSettings(TabContents* tab)
: TabContentsObserver(tab),
- allowed_local_shared_objects_(tab->profile()),
- blocked_local_shared_objects_(tab->profile()),
- geolocation_settings_state_(tab->profile()),
+ profile_(static_cast<Profile*>(tab->browser_context())),
+ allowed_local_shared_objects_(profile_),
+ blocked_local_shared_objects_(profile_),
+ geolocation_settings_state_(profile_),
load_plugins_link_enabled_(true) {
ClearBlockedContentSettingsExceptForCookies();
ClearCookieSpecificContentSettings();
@@ -57,7 +58,7 @@ TabSpecificContentSettings::TabSpecificContentSettings(TabContents* tab)
registrar_.Add(this, chrome::NOTIFICATION_CONTENT_SETTINGS_CHANGED,
Source<HostContentSettingsMap>(
- tab->profile()->GetHostContentSettingsMap()));
+ profile_->GetHostContentSettingsMap()));
}
TabSpecificContentSettings::~TabSpecificContentSettings() {
@@ -434,8 +435,7 @@ void TabSpecificContentSettings::DidNavigateMainFramePostCommit(
void TabSpecificContentSettings::RenderViewCreated(
RenderViewHost* render_view_host) {
- HostContentSettingsMap* map =
- tab_contents()->profile()->GetHostContentSettingsMap();
+ HostContentSettingsMap* map = profile_->GetHostContentSettingsMap();
render_view_host->Send(new ViewMsg_SetDefaultContentSettings(
map->GetDefaultContentSettings()));
}
@@ -472,8 +472,7 @@ void TabSpecificContentSettings::Observe(int type,
// The active NavigationEntry is the URL in the URL field of a tab.
// Currently this should be matched by the |primary_pattern|.
settings_details.ptr()->primary_pattern().Matches(entry_url)) {
- HostContentSettingsMap* map =
- tab_contents()->profile()->GetHostContentSettingsMap();
+ HostContentSettingsMap* map = profile_->GetHostContentSettingsMap();
Send(new ViewMsg_SetDefaultContentSettings(
map->GetDefaultContentSettings()));
Send(new ViewMsg_SetContentSettingsForCurrentURL(

Powered by Google App Engine
This is Rietveld 408576698