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 @@ ...@@ -85,9 +85,6 @@
<message name="IDS_APP_MANAGEMENT_STORAGE" desc="Label for the Android storage permission toggle."> <message name="IDS_APP_MANAGEMENT_STORAGE" desc="Label for the Android storage permission toggle.">
Storage Storage
</message> </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."> <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. This app has been installed by your administrator.
</message> </message>
......
...@@ -14,11 +14,6 @@ ...@@ -14,11 +14,6 @@
border-top: none; border-top: none;
} }
#app-description {
padding-bottom: 12px;
padding-top: 24px;
}
#no-permissions { #no-permissions {
border-top: none; border-top: none;
} }
...@@ -29,9 +24,6 @@ ...@@ -29,9 +24,6 @@
</style> </style>
<div> <div>
<div id="app-description" class="permission-card-row">
[[app_.description]]
</div>
<div class="permission-list"> <div class="permission-list">
<app-management-pin-to-shelf-item <app-management-pin-to-shelf-item
id="pin-to-shelf-setting" id="pin-to-shelf-setting"
......
...@@ -36,7 +36,6 @@ Polymer({ ...@@ -36,7 +36,6 @@ Polymer({
const {messages: messages} = const {messages: messages} =
await app_management.BrowserProxy.getInstance() await app_management.BrowserProxy.getInstance()
.handler.getExtensionAppPermissionMessages(this.app_.id); .handler.getExtensionAppPermissionMessages(this.app_.id);
this.$['app-description'].hidden = this.app_.description.length === 0;
this.messages_ = messages; this.messages_ = messages;
}, },
......
...@@ -25,15 +25,17 @@ ...@@ -25,15 +25,17 @@
<cr-tooltip-icon <cr-tooltip-icon
id="policyIndicator" id="policyIndicator"
icon-class="cr20:domain" icon-class="cr20:domain"
tooltip-text="[[getTooltip_(app_)]]" tooltip-text="$i18n{policyAppUninstallPolicy}"
icon-aria-label="[[getTooltip_(app_)]]" icon-aria-label="$i18n{policyAppUninstallPolicy}"
tooltip-position="bottom"> tooltip-position="bottom">
</cr-tooltip-icon> </cr-tooltip-icon>
</template> </template>
<cr-button id="uninstallButton" on-click="onClick_" <template is="dom-if" if="[[showUninstallButton_(app_)]]">
disabled$="[[getDisableState_(app_)]]"> <cr-button id="uninstallButton" on-click="onClick_"
$i18n{uninstallApp} disabled$="[[getDisableState_(app_)]]">
</cr-button> $i18n{uninstallApp}
</cr-button>
</template>
</template> </template>
<script src="uninstall_button.js"></script> <script src="uninstall_button.js"></script>
</dom-module> </dom-module>
...@@ -6,7 +6,6 @@ Polymer({ ...@@ -6,7 +6,6 @@ Polymer({
is: 'app-management-uninstall-button', is: 'app-management-uninstall-button',
behaviors: [ behaviors: [
I18nBehavior,
app_management.StoreClient, app_management.StoreClient,
], ],
...@@ -50,40 +49,29 @@ Polymer({ ...@@ -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 * @param {App} app
* @return {?string} * @returns {boolean}
* @private * @private
*/ */
getTooltip_: function(app) { showPolicyIndicator_: function(app) {
if (!app) { if (!app) {
return ''; return false;
}
switch (app.installSource) {
case InstallSource.kSystem:
return this.i18n('systemAppUninstallPolicy');
case InstallSource.kPolicy:
return this.i18n('policyAppUninstallPolicy');
default:
assertNotReached();
} }
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 * @param {App} app
* @returns {boolean}
* @private
*/ */
showPolicyIndicator_: function(app) { showUninstallButton_: function(app) {
if (!app) { if (!app) {
return false; return false;
} }
return app.installSource === InstallSource.kPolicy || return app.installSource !== InstallSource.kSystem;
app.installSource === InstallSource.kSystem;
}, },
/** /**
......
...@@ -669,7 +669,6 @@ void AddAppManagementStrings(content::WebUIDataSource* html_source) { ...@@ -669,7 +669,6 @@ void AddAppManagementStrings(content::WebUIDataSource* html_source) {
{"policyAppUninstallPolicy", IDS_APP_MANAGEMENT_POLICY_APP_POLICY_STRING}, {"policyAppUninstallPolicy", IDS_APP_MANAGEMENT_POLICY_APP_POLICY_STRING},
{"size", IDS_APP_MANAGEMENT_SIZE}, {"size", IDS_APP_MANAGEMENT_SIZE},
{"storage", IDS_APP_MANAGEMENT_STORAGE}, {"storage", IDS_APP_MANAGEMENT_STORAGE},
{"systemAppUninstallPolicy", IDS_APP_MANAGEMENT_SYSTEM_APP_POLICY_STRING},
{"thisAppCan", IDS_APP_MANAGEMENT_THIS_APP_CAN}, {"thisAppCan", IDS_APP_MANAGEMENT_THIS_APP_CAN},
{"title", IDS_APP_MANAGEMENT_TITLE}, {"title", IDS_APP_MANAGEMENT_TITLE},
{"uninstallApp", IDS_APP_MANAGEMENT_UNINSTALL_APP}, {"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