Commit 68d0d7f5 authored by Alexander Cooper's avatar Alexander Cooper Committed by Commit Bot

Show appropriate warnings for AR permissions in site settings

https://crrev.com/c/2085847 began showing an appropriate string to users
when they denied camera access after granting AR permissions; but missed
a few other places to indicate to the user that additional permissions
are missing. This change ensures that these warnings appear, similar to
the behavior with the camera permission.

Note that crrev.com/c/2087704 handles ensuring that the user is prompted
for the OS permission when attempting to use the site permission.

Bug: 1058055
Change-Id: I26f427c874100b4bfbe52925c3bcded2729591bd
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2090499
Commit-Queue: Alexander Cooper <alcooper@chromium.org>
Auto-Submit: Alexander Cooper <alcooper@chromium.org>
Reviewed-by: default avatarBalazs Engedy <engedy@chromium.org>
Reviewed-by: default avatarKamila Hasanbega <hkamila@chromium.org>
Cr-Commit-Position: refs/heads/master@{#749275}
parent 6b73c749
......@@ -675,6 +675,8 @@ public class SingleWebsiteSettings extends PreferenceFragmentCompat
return SiteSettingsCategory.createFromType(SiteSettingsCategory.Type.NOTIFICATIONS);
} else if (showWarningFor(SiteSettingsCategory.Type.NFC)) {
return SiteSettingsCategory.createFromType(SiteSettingsCategory.Type.NFC);
} else if (showWarningFor(SiteSettingsCategory.Type.AUGMENTED_REALITY)) {
return SiteSettingsCategory.createFromType(SiteSettingsCategory.Type.AUGMENTED_REALITY);
}
return null;
}
......
......@@ -127,7 +127,8 @@ public class SiteSettings
p.setOnPreferenceClickListener(this);
if ((Type.CAMERA == prefCategory || Type.MICROPHONE == prefCategory
|| Type.NOTIFICATIONS == prefCategory)
|| Type.NOTIFICATIONS == prefCategory
|| Type.AUGMENTED_REALITY == prefCategory)
&& SiteSettingsCategory.createFromType(prefCategory)
.showPermissionBlockedMessage(getActivity())) {
// Show 'disabled' message when permission is not granted in Android.
......
......@@ -106,6 +106,8 @@ public class SiteSettingsCategory {
permission = android.Manifest.permission.CAMERA;
} else if (type == Type.MICROPHONE) {
permission = android.Manifest.permission.RECORD_AUDIO;
} else if (type == Type.AUGMENTED_REALITY) {
permission = android.Manifest.permission.CAMERA;
} else {
permission = "";
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment