Commit c90a001b authored by Haiyang Pan's avatar Haiyang Pan Committed by Commit Bot

Revert "Update message in permission dialog overlay warning"

This reverts commit 37dea4b3.

Reason for revert: Likely caused the test failure of DownloadTest#testDuplicateHttpPostDownload_Cancel__UseDownloadOfflineContentProviderEnabled in android builders since:
* https://ci.chromium.org/p/chromium/builders/ci/android-marshmallow-x86-rel-non-cq/52
* https://ci.chromium.org/p/chromium/builders/ci/Lollipop%20Phone%20Tester/26965

Original change's description:
> Update message in permission dialog overlay warning
> 
> The current overlay warning message does not directly address the
> typical case: when dialer or chat bubble is displayed on the screen.
> 
> One change in behavior is that "Cancel" button of overlay warning dialog
> dismisses both overlay warning and permission dialog.
> 
> BUG=1127455
> R=​twellington@chromium.org
> 
> Change-Id: I9d5c13a6c7d4e52a3fa73b3193d1ef463272ab64
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2406148
> Reviewed-by: Theresa  <twellington@chromium.org>
> Reviewed-by: Andy Paicu <andypaicu@chromium.org>
> Commit-Queue: Pavel Yatsuk <pavely@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#807089}

TBR=pavely@chromium.org,twellington@chromium.org,andypaicu@chromium.org

Change-Id: I6ebee34a6bb6383b7ff58782608b81d0ec6d5cbb
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 1127455
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2412836Reviewed-by: default avatarHaiyang Pan <hypan@google.com>
Commit-Queue: Haiyang Pan <hypan@google.com>
Cr-Commit-Position: refs/heads/master@{#807278}
parent 61601922
...@@ -300,6 +300,9 @@ ...@@ -300,6 +300,9 @@
<message name="IDS_MENU_ITEM_MOVE_TO_TOP" desc="Option in item menu. User can click the 'Move to top' option to move the item up to the top of its list. [CHAR-LIMIT=24]"> <message name="IDS_MENU_ITEM_MOVE_TO_TOP" desc="Option in item menu. User can click the 'Move to top' option to move the item up to the top of its list. [CHAR-LIMIT=24]">
Move to top Move to top
</message> </message>
<message name="IDS_OPEN_SETTINGS" desc="Generic label for a button to show settings screen. [CHAR-LIMIT=20]">
Open settings
</message>
<message name="IDS_ACCESSIBILITY_TOOLBAR_BTN_MENU" desc="Content description for the settings menu button."> <message name="IDS_ACCESSIBILITY_TOOLBAR_BTN_MENU" desc="Content description for the settings menu button.">
More options More options
......
...@@ -6,6 +6,9 @@ package org.chromium.components.permissions; ...@@ -6,6 +6,9 @@ package org.chromium.components.permissions;
import android.annotation.SuppressLint; import android.annotation.SuppressLint;
import android.content.Context; import android.content.Context;
import android.content.Intent;
import android.os.Build;
import android.provider.Settings;
import androidx.annotation.IntDef; import androidx.annotation.IntDef;
import androidx.annotation.VisibleForTesting; import androidx.annotation.VisibleForTesting;
...@@ -173,18 +176,22 @@ public class PermissionDialogController ...@@ -173,18 +176,22 @@ public class PermissionDialogController
/** /**
* Displays the dialog explaining that Chrome has detected an overlay. Offers the user to close * Displays the dialog explaining that Chrome has detected an overlay. Offers the user to close
* the overlay window and try again. * overlay window or revoke "Draw on top" permission in Android settings.
*/ */
private void showFilteredTouchEventDialog(Context context) { private void showFilteredTouchEventDialog(Context context) {
// Settings.ACTION_MANAGE_OVERLAY_PERMISSION is only supported on M+ therefore we shouldn't
// display this dialog on L. The function won't be called on L anyway because touch
// filtering was introduced in M.
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) return;
// Don't show another dialog if one is already displayed. // Don't show another dialog if one is already displayed.
if (mOverlayDetectedDialogModel != null) return; if (mOverlayDetectedDialogModel != null) return;
ModalDialogProperties.Controller overlayDetectedDialogController = ModalDialogProperties.Controller overlayDetectedDialogController =
new SimpleModalDialogController(mModalDialogManager, (Integer dismissalCause) -> { new SimpleModalDialogController(mModalDialogManager, (Integer dismissalCause) -> {
if (dismissalCause == DialogDismissalCause.POSITIVE_BUTTON_CLICKED if (dismissalCause == DialogDismissalCause.POSITIVE_BUTTON_CLICKED) {
&& mDialogModel != null) { context.startActivity(
mModalDialogManager.dismissDialog( new Intent(Settings.ACTION_MANAGE_OVERLAY_PERMISSION));
mDialogModel, DialogDismissalCause.NAVIGATE_BACK_OR_TOUCH_OUTSIDE);
} }
mOverlayDetectedDialogModel = null; mOverlayDetectedDialogModel = null;
}); });
...@@ -197,7 +204,7 @@ public class PermissionDialogController ...@@ -197,7 +204,7 @@ public class PermissionDialogController
.with(ModalDialogProperties.MESSAGE, context.getResources(), .with(ModalDialogProperties.MESSAGE, context.getResources(),
R.string.overlay_detected_dialog_message) R.string.overlay_detected_dialog_message)
.with(ModalDialogProperties.POSITIVE_BUTTON_TEXT, context.getResources(), .with(ModalDialogProperties.POSITIVE_BUTTON_TEXT, context.getResources(),
R.string.cancel) R.string.open_settings)
.with(ModalDialogProperties.NEGATIVE_BUTTON_TEXT, context.getResources(), .with(ModalDialogProperties.NEGATIVE_BUTTON_TEXT, context.getResources(),
R.string.try_again) R.string.try_again)
.with(ModalDialogProperties.CANCEL_ON_TOUCH_OUTSIDE, true) .with(ModalDialogProperties.CANCEL_ON_TOUCH_OUTSIDE, true)
......
...@@ -198,10 +198,10 @@ ...@@ -198,10 +198,10 @@
<!-- Overlay detected dialog --> <!-- Overlay detected dialog -->
<message name="IDS_OVERLAY_DETECTED_DIALOG_TITLE" desc="Title of the dialog that informs the user about detected overlay window that prevents interaction with permissions."> <message name="IDS_OVERLAY_DETECTED_DIALOG_TITLE" desc="Title of the dialog that informs the user about detected overlay window that prevents interaction with permissions.">
This site can’t ask for your permission Another app is displaying over <ph name="APP_NAME">%1$s<ex>Chrome</ex></ph>
</message> </message>
<message name="IDS_OVERLAY_DETECTED_DIALOG_MESSAGE" desc="Dialog message that informs the user about detected overlay window that prevents interaction with permissions."> <message name="IDS_OVERLAY_DETECTED_DIALOG_MESSAGE" desc="Dialog message that informs the user about detected overlay window that prevents interaction with permissions.">
Close any bubbles or overlays from other apps. Then, try again. To change the permission for this site, close the other app and try again.\n\nIf you can’t close the app, turn off the app’s permission to “Display over other apps” in Android settings.
</message> </message>
</messages> </messages>
</release> </release>
......
9d91339a62c7718bb8da43b6702173172723980d 59eeb17905a49e3917ea3de287f529e8de3df872
\ No newline at end of file \ No newline at end of file
9d91339a62c7718bb8da43b6702173172723980d 59eeb17905a49e3917ea3de287f529e8de3df872
\ No newline at end of file \ No newline at end of file
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