Commit fe575b2a authored by Pavel Yatsuk's avatar Pavel Yatsuk Committed by Commit Bot

Reland "Update message in permission dialog overlay warning"

This is a reland of 37dea4b3
Wasn't actually the culprit of failing tests.

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}

Bug: 1127455
Change-Id: Ia973a989f70d4a094b0d620b4ae4970482d21fc9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2414672Reviewed-by: default avatarTheresa  <twellington@chromium.org>
Reviewed-by: default avatarBalazs Engedy <engedy@chromium.org>
Reviewed-by: default avatarPavel Yatsuk <pavely@chromium.org>
Commit-Queue: Balazs Engedy <engedy@chromium.org>
Auto-Submit: Haiyang Pan <hypan@google.com>
Cr-Commit-Position: refs/heads/master@{#807937}
parent 354f30db
...@@ -300,9 +300,6 @@ ...@@ -300,9 +300,6 @@
<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,9 +6,6 @@ package org.chromium.components.permissions; ...@@ -6,9 +6,6 @@ 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;
...@@ -176,22 +173,18 @@ public class PermissionDialogController ...@@ -176,22 +173,18 @@ 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
* overlay window or revoke "Draw on top" permission in Android settings. * the overlay window and try again.
*/ */
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
context.startActivity( && mDialogModel != null) {
new Intent(Settings.ACTION_MANAGE_OVERLAY_PERMISSION)); mModalDialogManager.dismissDialog(
mDialogModel, DialogDismissalCause.NAVIGATE_BACK_OR_TOUCH_OUTSIDE);
} }
mOverlayDetectedDialogModel = null; mOverlayDetectedDialogModel = null;
}); });
...@@ -204,7 +197,7 @@ public class PermissionDialogController ...@@ -204,7 +197,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.open_settings) R.string.cancel)
.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.">
Another app is displaying over <ph name="APP_NAME">%1$s<ex>Chrome</ex></ph> This site can’t ask for your permission
</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.">
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. Close any bubbles or overlays from other apps. Then, try again.
</message> </message>
</messages> </messages>
</release> </release>
......
59eeb17905a49e3917ea3de287f529e8de3df872 9d91339a62c7718bb8da43b6702173172723980d
\ No newline at end of file \ No newline at end of file
59eeb17905a49e3917ea3de287f529e8de3df872 9d91339a62c7718bb8da43b6702173172723980d
\ 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