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

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: Fixed patch conflict 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 f15526f0fcad54517291b421c1a87aaad1683302..08aa66f177c1dddad5d73f6dd45545c40655956b 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"
@@ -593,9 +594,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);
}
@@ -638,11 +640,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;
}
@@ -651,7 +655,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;
}
@@ -787,7 +791,8 @@ void ContentSettingsHandler::UpdateExceptionsViewFromModel(
// 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(
@@ -1312,7 +1317,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
@@ -1467,7 +1473,8 @@ std::string ContentSettingsHandler::ContentSettingsTypeToGroupName(
}
HostContentSettingsMap* ContentSettingsHandler::GetContentSettingsMap() {
- return Profile::FromWebUI(web_ui())->GetHostContentSettingsMap();
+ return HostContentSettingsMapFactory::GetForProfile(
+ Profile::FromWebUI(web_ui()));
}
ProtocolHandlerRegistry* ContentSettingsHandler::GetProtocolHandlerRegistry() {
@@ -1479,7 +1486,8 @@ HostContentSettingsMap*
ContentSettingsHandler::GetOTRContentSettingsMap() {
Profile* profile = Profile::FromWebUI(web_ui());
if (profile->HasOffTheRecordProfile())
- return profile->GetOffTheRecordProfile()->GetHostContentSettingsMap();
+ return HostContentSettingsMapFactory::GetForProfile(
+ profile->GetOffTheRecordProfile());
return NULL;
}
« no previous file with comments | « chrome/browser/ui/website_settings/website_settings_unittest.cc ('k') | chrome/browser/ui/webui/plugins_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698