Commit 6681704d authored by Rayan Kanso's avatar Rayan Kanso Committed by Commit Bot

Revert "Added IPH for the mini-infobar notification permission prompt (android)"

This reverts commit 6e91b688.

Reason for revert: Broke the build
- https://ci.chromium.org/p/chrome/builders/ci/android-internal-chromium-tot/44960
- https://ci.chromium.org/p/chrome/builders/ci/arm64-builder-rel/20383

Original change's description:
> Added IPH for the mini-infobar notification permission prompt (android)
> 
> As part of the new quieter notification prompt, add IPH for the android
> quieter notification permission prompt. To be shown the first time
> the setting is enabled.
> 
> This is controlled by using the functions:
> * AdaptiveNotificationPermissionUiSelector::ShouldShowPromo
> * AdaptiveNotificationPermissionUiSelector::PromoWasShown
> 
> Quick mock of how this is supposed to look:
> https://docs.google.com/document/d/1hsp1j08yzIK6M6G7pbsdEihU8CLN7QQ3V2iAxESrqQM/edit?usp=sharing
> 
> Bug: 1029595
> Change-Id: I3c90dda846a70396f1130c2ad6dcfc3622b9b25f
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1944173
> Commit-Queue: Andy Paicu <andypaicu@chromium.org>
> Reviewed-by: Brian White <bcwhite@chromium.org>
> Reviewed-by: Matthew Jones <mdjones@chromium.org>
> Reviewed-by: Kamila Hasanbega <hkamila@chromium.org>
> Reviewed-by: David Trainor <dtrainor@chromium.org>
> Reviewed-by: Balazs Engedy <engedy@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#721442}

TBR=nyquist@chromium.org,engedy@chromium.org,dtrainor@chromium.org,bcwhite@chromium.org,mdjones@chromium.org,bsazonov@chromium.org,andypaicu@chromium.org,hkamila@chromium.org

Change-Id: Id1c9af183ed460c6e0e1159c66ec561236b13d2e
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 1029595
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1950527Reviewed-by: default avatarRayan Kanso <rayankans@chromium.org>
Commit-Queue: Rayan Kanso <rayankans@chromium.org>
Cr-Commit-Position: refs/heads/master@{#721459}
parent 541d6521
......@@ -2682,7 +2682,6 @@ generate_jni("chrome_jni_headers") {
"java/src/org/chromium/chrome/browser/payments/SslValidityChecker.java",
"java/src/org/chromium/chrome/browser/permissions/PermissionDialogController.java",
"java/src/org/chromium/chrome/browser/permissions/PermissionDialogDelegate.java",
"java/src/org/chromium/chrome/browser/permissions/PermissionSettingsBridge.java",
"java/src/org/chromium/chrome/browser/permissions/PermissionUmaUtil.java",
"java/src/org/chromium/chrome/browser/photo_picker/DecoderService.java",
"java/src/org/chromium/chrome/browser/policy/PolicyAuditor.java",
......
......@@ -1260,7 +1260,6 @@ chrome_java_sources = [
"java/src/org/chromium/chrome/browser/permissions/PermissionDialogController.java",
"java/src/org/chromium/chrome/browser/permissions/PermissionDialogDelegate.java",
"java/src/org/chromium/chrome/browser/permissions/PermissionFieldTrial.java",
"java/src/org/chromium/chrome/browser/permissions/PermissionSettingsBridge.java",
"java/src/org/chromium/chrome/browser/permissions/PermissionUmaUtil.java",
"java/src/org/chromium/chrome/browser/photo_picker/BitmapScalerTask.java",
"java/src/org/chromium/chrome/browser/photo_picker/BitmapUtils.java",
......
......@@ -9,16 +9,13 @@ import android.view.View;
import androidx.annotation.Nullable;
import org.chromium.chrome.R;
import org.chromium.chrome.browser.download.DownloadInfoBarController;
import org.chromium.chrome.browser.download.DownloadManagerService;
import org.chromium.chrome.browser.feature_engagement.TrackerFactory;
import org.chromium.chrome.browser.infobar.IPHInfoBarSupport.PopupState;
import org.chromium.chrome.browser.infobar.IPHInfoBarSupport.TrackerParameters;
import org.chromium.chrome.browser.permissions.PermissionSettingsBridge;
import org.chromium.chrome.browser.profiles.Profile;
import org.chromium.chrome.browser.ui.widget.textbubble.TextBubble;
import org.chromium.components.feature_engagement.FeatureConstants;
import org.chromium.components.feature_engagement.Tracker;
/**
......@@ -64,14 +61,6 @@ class IPHBubbleDelegateImpl implements IPHInfoBarSupport.IPHBubbleDelegate {
DownloadManagerService.getDownloadManagerService()
.getInfoBarController(Profile.getLastUsedProfile().isOffTheRecord());
return controller != null ? controller.getTrackerParameters() : null;
case InfoBarIdentifier.GROUPED_PERMISSION_INFOBAR_DELEGATE_ANDROID:
if (PermissionSettingsBridge.shouldShowNotificationsPromo()) {
PermissionSettingsBridge.didShowNotificationsPromo();
return new IPHInfoBarSupport.TrackerParameters(
FeatureConstants.QUIET_NOTIFICATION_PROMPTS_FEATURE,
R.string.notifications_iph, R.string.notifications_iph);
}
return null;
default:
return null;
}
......
// Copyright 2019 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
package org.chromium.chrome.browser.permissions;
import org.chromium.base.annotations.NativeMethods;
import org.chromium.chrome.browser.profiles.Profile;
/**
* Utility class that interacts with native to retrieve and set permission-related settings.
*/
public class PermissionSettingsBridge {
public static boolean shouldShowNotificationsPromo() {
return PermissionSettingsBridgeJni.get().shouldShowNotificationsPromo(getProfile());
}
public static void didShowNotificationsPromo() {
PermissionSettingsBridgeJni.get().didShowNotificationsPromo(getProfile());
}
private static Profile getProfile() {
return Profile.getLastUsedProfile().getOriginalProfile();
}
@NativeMethods
public interface Natives {
boolean shouldShowNotificationsPromo(Profile profile);
void didShowNotificationsPromo(Profile profile);
}
}
......@@ -2575,7 +2575,6 @@ jumbo_static_library("browser") {
"android/password_ui_view_android.cc",
"android/password_ui_view_android.h",
"android/payments/service_worker_payment_app_bridge.cc",
"android/permissions/permission_settings_bridge.cc",
"android/photo_picker_sandbox_bridge.cc",
"android/policy/policy_auditor.cc",
"android/preferences/about_settings_bridge.cc",
......
file://chrome/browser/permissions/PERMISSIONS_OWNERS
// Copyright 2019 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "base/android/scoped_java_ref.h"
#include "chrome/android/chrome_jni_headers/PermissionSettingsBridge_jni.h"
#include "chrome/browser/permissions/adaptive_notification_permission_ui_selector.h"
#include "chrome/browser/profiles/profile_android.h"
using base::android::JavaParamRef;
static jboolean JNI_PermissionSettingsBridge_ShouldShowNotificationsPromo(
JNIEnv* env,
const JavaParamRef<jobject>& jprofile) {
return AdaptiveNotificationPermissionUiSelector::GetForProfile(
ProfileAndroid::FromProfileAndroid(jprofile))
->ShouldShowPromo();
}
static void JNI_PermissionSettingsBridge_DidShowNotificationsPromo(
JNIEnv* env,
const JavaParamRef<jobject>& jprofile) {
AdaptiveNotificationPermissionUiSelector::GetForProfile(
ProfileAndroid::FromProfileAndroid(jprofile))
->PromoWasShown();
}
......@@ -1147,8 +1147,8 @@ Your Google account may have other forms of browsing history like searches and a
<message name="IDS_WEBSITE_SETTINGS_CATEGORY_NOTIFICATIONS_QUIET_SUMMARY_DISABLED" desc="A summary explaining how quiet notifications work, when the setting is disabled.">
Enable to automatically block sites from asking to show you notifications. If a site requests notifications, an infobar will appear at the bottom of the page.
</message>
<message name="IDS_NOTIFICATIONS_IPH" desc="A message that explains to the users that notification permission requests will appear as an infobar from now on because the user repeatedly denied the notification permission in the past.">
You usually block notifications. To allow, tap Details.
<message name="IDS_NOTIFICATIONS_IPH" desc="A message that explains to the users that notification permission requests will appear as an infobar from now on.">
Got it. By default new notification requests will appear here.
</message>
<message name="IDS_WEBSITE_SETTINGS_CATEGORY_CAMERA_ASK" desc="Summary text explaining that sites need to ask for permission before accessing the camera and that it is the recommended setting.">
Ask first before allowing sites to use your camera (recommended)
......
......@@ -36,8 +36,7 @@ import java.lang.annotation.RetentionPolicy;
FeatureConstants.TAB_GROUPS_TAP_TO_SEE_ANOTHER_TAB_FEATURE,
FeatureConstants.TAB_GROUPS_YOUR_TABS_ARE_TOGETHER_FEATURE,
FeatureConstants.FEED_CARD_MENU_FEATURE, FeatureConstants.IDENTITY_DISC_FEATURE,
FeatureConstants.TAB_GROUPS_DRAG_AND_DROP_FEATURE,
FeatureConstants.QUIET_NOTIFICATION_PROMPTS_FEATURE})
FeatureConstants.TAB_GROUPS_DRAG_AND_DROP_FEATURE})
@Retention(RetentionPolicy.SOURCE)
public @interface FeatureConstants {
String DOWNLOAD_PAGE_FEATURE = "IPH_DownloadPage";
......@@ -127,10 +126,4 @@ public @interface FeatureConstants {
* services" preferences.
*/
String IDENTITY_DISC_FEATURE = "IPH_IdentityDisc";
/**
* An IPH feature showing up the first time the user is presented with the quieter version of
* the permission prompt (for notifications).
*/
String QUIET_NOTIFICATION_PROMPTS_FEATURE = "IPH_QuietNotificationPrompts";
}
......@@ -71,8 +71,6 @@ const base::Feature kIPHDownloadInfoBarDownloadContinuingFeature{
"IPH_DownloadInfoBarDownloadContinuing", base::FEATURE_DISABLED_BY_DEFAULT};
const base::Feature kIPHDownloadInfoBarDownloadsAreFasterFeature{
"IPH_DownloadInfoBarDownloadsAreFaster", base::FEATURE_DISABLED_BY_DEFAULT};
const base::Feature kIPHQuietNotificationPromptsFeature{
"IPH_QuietNotificationPrompts", base::FEATURE_DISABLED_BY_DEFAULT};
const base::Feature kIPHFeedCardMenuFeature{"IPH_FeedCardMenu",
base::FEATURE_DISABLED_BY_DEFAULT};
const base::Feature kIPHIdentityDiscFeature{"IPH_IdentityDisc",
......
......@@ -62,7 +62,6 @@ extern const base::Feature kIPHKeyboardAccessoryPasswordFillingFeature;
extern const base::Feature kIPHKeyboardAccessoryPaymentFillingFeature;
extern const base::Feature kIPHNewTabPageButtonFeature;
extern const base::Feature kIPHPreviewsOmniboxUIFeature;
extern const base::Feature kIPHQuietNotificationPromptsFeature;
extern const base::Feature kIPHTabGroupsQuicklyComparePagesFeature;
extern const base::Feature kIPHTabGroupsTapToSeeAnotherTabFeature;
extern const base::Feature kIPHTabGroupsYourTabsAreTogetherFeature;
......
......@@ -41,7 +41,6 @@ const base::Feature* const kAllFeatures[] = {
&kIPHKeyboardAccessoryPasswordFillingFeature,
&kIPHKeyboardAccessoryPaymentFillingFeature,
&kIPHPreviewsOmniboxUIFeature,
&kIPHQuietNotificationPromptsFeature,
&kIPHTabGroupsQuicklyComparePagesFeature,
&kIPHTabGroupsTapToSeeAnotherTabFeature,
&kIPHTabGroupsYourTabsAreTogetherFeature,
......
......@@ -85,8 +85,6 @@ DEFINE_VARIATION_PARAM(kIPHKeyboardAccessoryPasswordFillingFeature,
DEFINE_VARIATION_PARAM(kIPHKeyboardAccessoryPaymentFillingFeature,
"IPH_KeyboardAccessoryPaymentFilling");
DEFINE_VARIATION_PARAM(kIPHPreviewsOmniboxUIFeature, "IPH_PreviewsOmniboxUI");
DEFINE_VARIATION_PARAM(kIPHQuietNotificationPromptsFeature,
"IPH_QuietNotificationPrompts");
DEFINE_VARIATION_PARAM(kIPHTabGroupsQuicklyComparePagesFeature,
"IPH_TabGroupsQuicklyComparePages");
DEFINE_VARIATION_PARAM(kIPHTabGroupsTapToSeeAnotherTabFeature,
......@@ -155,7 +153,6 @@ constexpr flags_ui::FeatureEntry::FeatureVariation
VARIATION_ENTRY(kIPHKeyboardAccessoryPasswordFillingFeature),
VARIATION_ENTRY(kIPHKeyboardAccessoryPaymentFillingFeature),
VARIATION_ENTRY(kIPHPreviewsOmniboxUIFeature),
VARIATION_ENTRY(kIPHQuietNotificationPromptsFeature),
VARIATION_ENTRY(kIPHTabGroupsQuicklyComparePagesFeature),
VARIATION_ENTRY(kIPHTabGroupsTapToSeeAnotherTabFeature),
VARIATION_ENTRY(kIPHTabGroupsYourTabsAreTogetherFeature),
......
......@@ -395,26 +395,6 @@
]
}
],
"AndroidInProductHelpQuietNotificationPrompts": [
{
"platforms": [
"android"
],
"experiments": [
{
"name": "Enabled",
"params": {
"availability": "any",
"event_trigger": "name:tabgroups_dummy;comparator:any;window:1;storage:1",
"event_used": "name:tabgroups_dummy;comparator:any;window:1;storage:1"
},
"enable_features": [
"IPH_QuietNotificationPrompts"
]
}
]
}
],
"AndroidInlineUpdateFlowStudy": [
{
"platforms": [
......
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