Commit 64b82d94 authored by Jeevan Shikaram's avatar Jeevan Shikaram Committed by Commit Bot

[App Management] Small UI changes.

Hide the uninstall button for system apps and remove the description
for Chrome apps.

Before: https://bugs.chromium.org/p/chromium/issues/attachment?aid=415747&signed_aid=gwLp8IV1DTB8pINqUZ3Twg==&inline=1
After: https://bugs.chromium.org/p/chromium/issues/attachment?aid=415748&signed_aid=klGiEUGbTUYNh9P4-D_3HA==&inline=1

Bug: 1013034
Change-Id: I34a271d52eef8c0ed66b7fa7010d27fce3376968
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1851786
Commit-Queue: Jeevan Shikaram <jshikaram@chromium.org>
Reviewed-by: default avatarcalamity <calamity@chromium.org>
Cr-Commit-Position: refs/heads/master@{#704521}
parent 0df5ece6
......@@ -85,9 +85,6 @@
<message name="IDS_APP_MANAGEMENT_STORAGE" desc="Label for the Android storage permission toggle.">
Storage
</message>
<message name="IDS_APP_MANAGEMENT_SYSTEM_APP_POLICY_STRING" desc="Tooltip label explaining that an app cannot be uninstalled as it is a part of Chrome OS (the operating system).">
This app cannot be uninstalled as it is part of Chrome OS.
</message>
<message name="IDS_APP_MANAGEMENT_POLICY_APP_POLICY_STRING" desc="Tooltip label explaining that an app cannot be uninstalled as it has been installed by an adminstrator.">
This app has been installed by your administrator.
</message>
......
......@@ -14,11 +14,6 @@
border-top: none;
}
#app-description {
padding-bottom: 12px;
padding-top: 24px;
}
#no-permissions {
border-top: none;
}
......@@ -29,9 +24,6 @@
</style>
<div>
<div id="app-description" class="permission-card-row">
[[app_.description]]
</div>
<div class="permission-list">
<app-management-pin-to-shelf-item
id="pin-to-shelf-setting"
......
......@@ -36,7 +36,6 @@ Polymer({
const {messages: messages} =
await app_management.BrowserProxy.getInstance()
.handler.getExtensionAppPermissionMessages(this.app_.id);
this.$['app-description'].hidden = this.app_.description.length === 0;
this.messages_ = messages;
},
......
......@@ -25,15 +25,17 @@
<cr-tooltip-icon
id="policyIndicator"
icon-class="cr20:domain"
tooltip-text="[[getTooltip_(app_)]]"
icon-aria-label="[[getTooltip_(app_)]]"
tooltip-text="$i18n{policyAppUninstallPolicy}"
icon-aria-label="$i18n{policyAppUninstallPolicy}"
tooltip-position="bottom">
</cr-tooltip-icon>
</template>
<cr-button id="uninstallButton" on-click="onClick_"
disabled$="[[getDisableState_(app_)]]">
$i18n{uninstallApp}
</cr-button>
<template is="dom-if" if="[[showUninstallButton_(app_)]]">
<cr-button id="uninstallButton" on-click="onClick_"
disabled$="[[getDisableState_(app_)]]">
$i18n{uninstallApp}
</cr-button>
</template>
</template>
<script src="uninstall_button.js"></script>
</dom-module>
......@@ -6,7 +6,6 @@ Polymer({
is: 'app-management-uninstall-button',
behaviors: [
I18nBehavior,
app_management.StoreClient,
],
......@@ -50,40 +49,29 @@ Polymer({
},
/**
* Returns string to be shown as a tool tip over the policy indicator.
* Returns true if the app was installed by a policy.
*
* @param {App} app
* @return {?string}
* @returns {boolean}
* @private
*/
getTooltip_: function(app) {
showPolicyIndicator_: function(app) {
if (!app) {
return '';
}
switch (app.installSource) {
case InstallSource.kSystem:
return this.i18n('systemAppUninstallPolicy');
case InstallSource.kPolicy:
return this.i18n('policyAppUninstallPolicy');
default:
assertNotReached();
return false;
}
return app.installSource === InstallSource.kPolicy;
},
/**
* Returns true if the app was installed by a policy
* Returns true if the uninstall button should be shown.
*
* @param {App} app
* @returns {boolean}
* @private
*/
showPolicyIndicator_: function(app) {
showUninstallButton_: function(app) {
if (!app) {
return false;
}
return app.installSource === InstallSource.kPolicy ||
app.installSource === InstallSource.kSystem;
return app.installSource !== InstallSource.kSystem;
},
/**
......
......@@ -669,7 +669,6 @@ void AddAppManagementStrings(content::WebUIDataSource* html_source) {
{"policyAppUninstallPolicy", IDS_APP_MANAGEMENT_POLICY_APP_POLICY_STRING},
{"size", IDS_APP_MANAGEMENT_SIZE},
{"storage", IDS_APP_MANAGEMENT_STORAGE},
{"systemAppUninstallPolicy", IDS_APP_MANAGEMENT_SYSTEM_APP_POLICY_STRING},
{"thisAppCan", IDS_APP_MANAGEMENT_THIS_APP_CAN},
{"title", IDS_APP_MANAGEMENT_TITLE},
{"uninstallApp", IDS_APP_MANAGEMENT_UNINSTALL_APP},
......
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