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

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

Issue 2537083002: Make dismiss works for PermissionPromptAndroid (Closed)
Patch Set: remove dependency and land this first Created 4 years, 1 month 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 5c99fbd3668796176b5a1b073fa2f16d013f9c3b..4fbe7f9a93e10c26334648f144233f914e30c87d 100644
--- a/chrome/browser/permissions/permission_context_base.cc
+++ b/chrome/browser/permissions/permission_context_base.cc
@@ -224,26 +224,26 @@ void PermissionContextBase::PermissionDecided(
const BrowserPermissionCallback& callback,
bool persist,
ContentSetting content_setting) {
-#if !defined(OS_ANDROID)
- // Infobar persistence and its related UMA is tracked on the infobar
- // controller directly.
- PermissionRequestGestureType gesture_type =
- user_gesture ? PermissionRequestGestureType::GESTURE
- : PermissionRequestGestureType::NO_GESTURE;
- 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 {
- PermissionUmaUtil::PermissionDismissed(permission_type_, gesture_type,
+ if (PermissionRequestManager::IsEnabled()) {
+ // Infobar persistence and its related UMA is tracked on the infobar
+ // controller directly.
+ PermissionRequestGestureType gesture_type =
+ user_gesture ? PermissionRequestGestureType::GESTURE
+ : PermissionRequestGestureType::NO_GESTURE;
+ 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 {
+ PermissionUmaUtil::PermissionDismissed(permission_type_, gesture_type,
+ requesting_origin, profile_);
+ }
}
-#endif
// Check if we should convert a dismiss decision into a block decision. This
// is gated on enabling the kBlockPromptsIfDismissedOften feature.

Powered by Google App Engine
This is Rietveld 408576698