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

Unified Diff: chrome/browser/permissions/permission_manager.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/permissions/permission_manager.cc
diff --git a/chrome/browser/permissions/permission_manager.cc b/chrome/browser/permissions/permission_manager.cc
index f5564e6ec45908ef4f39e89e80cbf380f6391e97..6aa0728dc9bd125e6a6276451fee58a22201bb8a 100644
--- a/chrome/browser/permissions/permission_manager.cc
+++ b/chrome/browser/permissions/permission_manager.cc
@@ -5,6 +5,7 @@
#include "chrome/browser/permissions/permission_manager.h"
#include "base/callback.h"
+#include "chrome/browser/content_settings/host_content_settings_map_factory.h"
#include "chrome/browser/permissions/permission_context.h"
#include "chrome/browser/permissions/permission_context_base.h"
#include "chrome/browser/permissions/permission_request_id.h"
@@ -135,7 +136,8 @@ PermissionManager::PermissionManager(Profile* profile)
PermissionManager::~PermissionManager() {
if (!subscriptions_.IsEmpty())
- profile_->GetHostContentSettingsMap()->RemoveObserver(this);
+ HostContentSettingsMapFactory::GetForProfile(profile_)
+ ->RemoveObserver(this);
}
void PermissionManager::RequestPermission(
@@ -233,7 +235,7 @@ void PermissionManager::RegisterPermissionUsage(PermissionType permission,
if (IsConstantPermission(permission))
return;
- profile_->GetHostContentSettingsMap()->UpdateLastUsage(
+ HostContentSettingsMapFactory::GetForProfile(profile_)->UpdateLastUsage(
requesting_origin,
embedding_origin,
PermissionTypeToContentSetting(permission));
@@ -245,7 +247,7 @@ int PermissionManager::SubscribePermissionStatusChange(
const GURL& embedding_origin,
const base::Callback<void(PermissionStatus)>& callback) {
if (subscriptions_.IsEmpty())
- profile_->GetHostContentSettingsMap()->AddObserver(this);
+ HostContentSettingsMapFactory::GetForProfile(profile_)->AddObserver(this);
Subscription* subscription = new Subscription();
subscription->permission = permission;
@@ -270,7 +272,8 @@ void PermissionManager::UnsubscribePermissionStatusChange(int subscription_id) {
subscriptions_.Remove(subscription_id);
if (subscriptions_.IsEmpty())
- profile_->GetHostContentSettingsMap()->RemoveObserver(this);
+ HostContentSettingsMapFactory::GetForProfile(profile_)
+ ->RemoveObserver(this);
}
bool PermissionManager::IsPermissionBubbleManagerMissing(

Powered by Google App Engine
This is Rietveld 408576698