Commit 8350dd0f authored by Toni Barzic's avatar Toni Barzic Committed by Commit Bot

AppUninstallDialog: Do not assume app domain is non-empty

AppUninstallDialog::InitializeCheckbox gets the app URL domain, and
changes the first domain character to upper-case, assuming that the
domain is non-empty. This may not be case if the app URL is an IP
address.

BUG=1084451

Change-Id: I5c43ff22fa3474a1c0ff0bcf79afd53de9beb26e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2521043Reviewed-by: default avatarNancy Wang <nancylingwang@chromium.org>
Commit-Queue: Toni Baržić <tbarzic@chromium.org>
Cr-Commit-Position: refs/heads/master@{#824671}
parent a668b729
...@@ -202,8 +202,8 @@ void AppUninstallDialogView::InitializeCheckbox(const GURL& app_start_url) { ...@@ -202,8 +202,8 @@ void AppUninstallDialogView::InitializeCheckbox(const GURL& app_start_url) {
auto domain = net::registry_controlled_domains::GetDomainAndRegistry( auto domain = net::registry_controlled_domains::GetDomainAndRegistry(
app_start_url, app_start_url,
net::registry_controlled_domains::INCLUDE_PRIVATE_REGISTRIES); net::registry_controlled_domains::INCLUDE_PRIVATE_REGISTRIES);
DCHECK(!domain.empty()); if (!domain.empty())
domain[0] = base::ToUpperASCII(domain[0]); domain[0] = base::ToUpperASCII(domain[0]);
replacements.push_back(base::ASCIIToUTF16(domain)); replacements.push_back(base::ASCIIToUTF16(domain));
} }
......
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