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

Unified Diff: chrome/browser/ui/webui/options/content_settings_handler.cc

Issue 1312453005: Removed Profile::GetHostContentSettingsMap (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/webui/options/content_settings_handler.cc
diff --git a/chrome/browser/ui/webui/options/content_settings_handler.cc b/chrome/browser/ui/webui/options/content_settings_handler.cc
index b5eccc44f0ae983e8a8b730908016182e2c40c52..2fccea94decd852691019b37869b2a558024226e 100644
--- a/chrome/browser/ui/webui/options/content_settings_handler.cc
+++ b/chrome/browser/ui/webui/options/content_settings_handler.cc
@@ -18,6 +18,7 @@
#include "base/values.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/chrome_notification_types.h"
+#include "chrome/browser/content_settings/host_content_settings_map_factory.h"
#include "chrome/browser/content_settings/web_site_settings_uma_util.h"
#include "chrome/browser/custom_handlers/protocol_handler_registry.h"
#include "chrome/browser/custom_handlers/protocol_handler_registry_factory.h"
@@ -564,9 +565,10 @@ void ContentSettingsHandler::InitializeHandler() {
flash_settings_manager_.reset(new PepperFlashSettingsManager(this, context));
Profile* profile = Profile::FromWebUI(web_ui());
- observer_.Add(profile->GetHostContentSettingsMap());
+ observer_.Add(HostContentSettingsMapFactory::GetForProfile(profile));
if (profile->HasOffTheRecordProfile()) {
- auto map = profile->GetOffTheRecordProfile()->GetHostContentSettingsMap();
+ auto map = HostContentSettingsMapFactory::GetForProfile(
+ profile->GetOffTheRecordProfile());
if (!observer_.IsObserving(map))
observer_.Add(map);
}
@@ -602,11 +604,13 @@ void ContentSettingsHandler::Observe(
switch (type) {
case chrome::NOTIFICATION_PROFILE_DESTROYED: {
Profile* profile = content::Source<Profile>(source).ptr();
+ HostContentSettingsMap* settings_map =
+ HostContentSettingsMapFactory::GetForProfile(profile);
if (profile->IsOffTheRecord() &&
- observer_.IsObserving(profile->GetHostContentSettingsMap())) {
+ observer_.IsObserving(settings_map)) {
web_ui()->CallJavascriptFunction(
"ContentSettingsExceptionsArea.OTRProfileDestroyed");
- observer_.Remove(profile->GetHostContentSettingsMap());
+ observer_.Remove(settings_map);
}
break;
}
@@ -615,7 +619,7 @@ void ContentSettingsHandler::Observe(
Profile* profile = content::Source<Profile>(source).ptr();
if (profile->IsOffTheRecord()) {
UpdateAllOTRExceptionsViewsFromModel();
- observer_.Add(profile->GetHostContentSettingsMap());
+ observer_.Add(HostContentSettingsMapFactory::GetForProfile(profile));
}
break;
}
@@ -811,7 +815,8 @@ void ContentSettingsHandler::UpdateOTRExceptionsViewFromModel(
// TODO(estade): merge with GetExceptionsFromHostContentSettingsMap.
void ContentSettingsHandler::UpdateGeolocationExceptionsView() {
Profile* profile = Profile::FromWebUI(web_ui());
- HostContentSettingsMap* map = profile->GetHostContentSettingsMap();
+ HostContentSettingsMap* map =
+ HostContentSettingsMapFactory::GetForProfile(profile);
ContentSettingsForOneType all_settings;
map->GetSettingsForOneType(
@@ -1336,7 +1341,8 @@ void ContentSettingsHandler::SetContentFilter(const base::ListValue* args) {
profile = profile->GetOriginalProfile();
#endif
- HostContentSettingsMap* map = profile->GetHostContentSettingsMap();
+ HostContentSettingsMap* map =
+ HostContentSettingsMapFactory::GetForProfile(profile);
// MEDIASTREAM is deprecated and the two separate settings MEDIASTREAM_CAMERA
// and MEDIASTREAM_MIC should be used instead. However, we still only have
@@ -1491,7 +1497,8 @@ std::string ContentSettingsHandler::ContentSettingsTypeToGroupName(
}
HostContentSettingsMap* ContentSettingsHandler::GetContentSettingsMap() {
- return Profile::FromWebUI(web_ui())->GetHostContentSettingsMap();
+ return HostContentSettingsMapFactory::GetForProfile(
+ Profile::FromWebUI(web_ui()));
}
ProtocolHandlerRegistry* ContentSettingsHandler::GetProtocolHandlerRegistry() {
@@ -1503,7 +1510,8 @@ HostContentSettingsMap*
ContentSettingsHandler::GetOTRContentSettingsMap() {
Profile* profile = Profile::FromWebUI(web_ui());
if (profile->HasOffTheRecordProfile())
- return profile->GetOffTheRecordProfile()->GetHostContentSettingsMap();
+ return HostContentSettingsMapFactory::GetForProfile(
+ profile->GetOffTheRecordProfile());
return NULL;
}

Powered by Google App Engine
This is Rietveld 408576698