Commit 1b02ffff authored by Eric Willigers's avatar Eric Willigers Committed by Commit Bot

Desktop PWAs: Web app uninstall dialog reads layout provider insets

The BubbleDialogDelegateView constructor set margins based on provider
GetDialogInsetsForContentType(TEXT, TEXT).
ExtensionUninstallDialogDelegateView then adjusted these margins.

The WebAppUninstallDialogDelegateView logic is based on
ExtensionUninstallDialogDelegateView, but it doesn't have the same
base class, so it was previously adjusting from 0 margins instead of
adjusting layout provider insets.

We now have consistent margin behavior between
ExtensionUninstallDialogDelegateView and
WebAppUninstallDialogDelegateView.

Bug: 1059166
Change-Id: I97ad4cacdf346b4686c6d76ab38ef84d34a6e871
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2094917
Auto-Submit: Eric Willigers <ericwilligers@chromium.org>
Commit-Queue: Alexey Baskakov <loyso@chromium.org>
Reviewed-by: default avatarAlexey Baskakov <loyso@chromium.org>
Cr-Commit-Position: refs/heads/master@{#748446}
parent 2d5cc932
......@@ -77,8 +77,9 @@ WebAppUninstallDialogDelegateView::WebAppUninstallDialogDelegateView(
// Add margins for the icon plus the icon-title padding so that the dialog
// contents align with the title text.
set_margins(margins() +
gfx::Insets(0, margins().left() + kIconSizeInDip, 0, 0));
gfx::Insets insets =
layout_provider->GetDialogInsetsForContentType(views::TEXT, views::TEXT);
set_margins(insets + gfx::Insets(0, insets.left() + kIconSizeInDip, 0, 0));
base::string16 checkbox_label = l10n_util::GetStringFUTF16(
IDS_EXTENSION_UNINSTALL_PROMPT_REMOVE_DATA_CHECKBOX,
......
......@@ -72,7 +72,7 @@ class WebAppUninstallDialogDelegateView : public views::DialogDelegateView {
gfx::ImageSkia image_;
// The web app we are showing the dialog for.
web_app::AppId app_id_;
const web_app::AppId app_id_;
// The dialog needs launch_url copy even if app gets uninstalled.
GURL app_launch_url_;
......
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