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

Unified Diff: chrome/browser/ui/page_info/page_info.cc

Issue 2790473004: Permissions: Clear embargo if user changes an embargoed permission's setting. (Closed)
Patch Set: Review comments. Created 3 years, 8 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
« no previous file with comments | « chrome/browser/permissions/permission_decision_auto_blocker_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/page_info/page_info.cc
diff --git a/chrome/browser/ui/page_info/page_info.cc b/chrome/browser/ui/page_info/page_info.cc
index 63002bac6fb22c26dad497eca9ccf8b68dac2b46..05f6f8efc74f3a54109306785d1132b217f6ecb2 100644
--- a/chrome/browser/ui/page_info/page_info.cc
+++ b/chrome/browser/ui/page_info/page_info.cc
@@ -32,6 +32,7 @@
#include "chrome/browser/history/history_service_factory.h"
#include "chrome/browser/infobars/infobar_service.h"
#include "chrome/browser/permissions/chooser_context_base.h"
+#include "chrome/browser/permissions/permission_decision_auto_blocker.h"
#include "chrome/browser/permissions/permission_manager.h"
#include "chrome/browser/permissions/permission_result.h"
#include "chrome/browser/permissions/permission_uma_util.h"
@@ -340,9 +341,14 @@ void PageInfo::OnSitePermissionChanged(ContentSettingsType type,
RecordPageInfoAction(PAGE_INFO_CHANGED_PERMISSION);
PermissionUtil::ScopedRevocationReporter scoped_revocation_reporter(
- this->profile_, this->site_url_, this->site_url_, type,
- PermissionSourceUI::OIB);
+ profile_, site_url_, site_url_, type, PermissionSourceUI::OIB);
+ // The permission may have been blocked due to being under embargo, so if it
+ // was changed away from BLOCK, clear embargo status if it exists.
+ if (setting != CONTENT_SETTING_BLOCK) {
+ PermissionDecisionAutoBlocker::GetForProfile(profile_)->RemoveEmbargoByUrl(
+ site_url_, type);
+ }
content_settings_->SetNarrowestContentSetting(site_url_, site_url_, type,
setting);
« no previous file with comments | « chrome/browser/permissions/permission_decision_auto_blocker_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698