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

Unified Diff: chrome/browser/permissions/permission_context_base.cc

Issue 2258763002: Add a feature-controlled persistence checkbox to geolocation prompts on desktop Views platforms. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@permission-infobardelegate-clean
Patch Set: Rebase Created 4 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_context_base.cc
diff --git a/chrome/browser/permissions/permission_context_base.cc b/chrome/browser/permissions/permission_context_base.cc
index c89c6012aa0dd89e7a3a13aa1688b272edb401fc..341e3f70776a2c4eb6be20facfeb3b2e08c92fba 100644
--- a/chrome/browser/permissions/permission_context_base.cc
+++ b/chrome/browser/permissions/permission_context_base.cc
@@ -220,18 +220,16 @@ void PermissionContextBase::PermissionDecided(
PermissionRequestGestureType gesture_type =
user_gesture ? PermissionRequestGestureType::GESTURE
: PermissionRequestGestureType::NO_GESTURE;
- if (persist) {
- DCHECK(content_setting == CONTENT_SETTING_ALLOW ||
- content_setting == CONTENT_SETTING_BLOCK);
- if (content_setting == CONTENT_SETTING_ALLOW) {
- PermissionUmaUtil::PermissionGranted(permission_type_, gesture_type,
- requesting_origin, profile_);
- } else {
- PermissionUmaUtil::PermissionDenied(permission_type_, gesture_type,
- requesting_origin, profile_);
- }
+ DCHECK(content_setting == CONTENT_SETTING_ALLOW ||
+ content_setting == CONTENT_SETTING_BLOCK ||
+ content_setting == CONTENT_SETTING_DEFAULT);
+ if (content_setting == CONTENT_SETTING_ALLOW) {
+ PermissionUmaUtil::PermissionGranted(permission_type_, gesture_type,
+ requesting_origin, profile_);
+ } else if (content_setting == CONTENT_SETTING_BLOCK) {
+ PermissionUmaUtil::PermissionDenied(permission_type_, gesture_type,
+ requesting_origin, profile_);
} else {
- DCHECK_EQ(content_setting, CONTENT_SETTING_DEFAULT);
PermissionUmaUtil::PermissionDismissed(permission_type_, gesture_type,
requesting_origin, profile_);
}
@@ -239,7 +237,7 @@ void PermissionContextBase::PermissionDecided(
// Check if we should convert a dismiss decision into a block decision. This
// is gated on enabling the kBlockPromptsIfDismissedOften feature.
- if (!persist &&
+ if (content_setting == CONTENT_SETTING_DEFAULT &&
decision_auto_blocker_->ShouldChangeDismissalToBlock(requesting_origin,
permission_type_)) {
persist = true;

Powered by Google App Engine
This is Rietveld 408576698