Commit 849b2f0a authored by Kelvin Jiang's avatar Kelvin Jiang Committed by Commit Bot

[Extensions] address comments from Demetrios from CL 1340876

What's been addressed:
add private/type annotation for navigationListener_ in activity_log.js

use logical css properties (margin/padding) for RTL support

remove trivial/default resolve function bodies in service.js

remove unnecessary type annotation (primitive type) in manager.js:100

add arrow icon to "View activity log" link from details page

remove excessive padding on the bottom of the activity log page,causing
scrolling to occur despite the page not having much content

Change-Id: I97bd2a77166ff212fe2204130c5c1783244053e6
Reviewed-on: https://chromium-review.googlesource.com/c/1345075Reviewed-by: default avatarDemetrios Papadopoulos <dpapad@chromium.org>
Commit-Queue: Kelvin Jiang <kelvinjiang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#611359}
parent 5de81321
......@@ -8,7 +8,7 @@
Allow on all websites
</message>
<message name="IDS_EXTENSIONS_VIEW_ACTIVITY_LOG" desc="The label of the button to click to view recent extension activity.">
View Activity Log
View activity log
</message>
<message name="IDS_EXTENSIONS_BACKGROUND_PAGE" desc="Display name for an autogenerated background page.">
background page
......
......@@ -19,6 +19,10 @@
margin-top: 80px;
text-align: center;
}
#activity-log-heading {
margin-inline-start: 16px;
}
</style>
<div class="page-container" id="container">
<div class="page-content">
......@@ -27,7 +31,7 @@
<button id="close-button" aria-label="$i18n{back}"
on-click="onCloseButtonTap_"></button>
</paper-icon-button-light>
<span>$i18n{activityLogPageHeading}</span>
<span id="activity-log-heading">$i18n{activityLogPageHeading}</span>
</div>
<div id="loading-activities" class="activity-message"
hidden$="[[!shouldShowLoadingMessage_(
......
......@@ -66,6 +66,7 @@ cr.define('extensions', function() {
onDataFetched: {type: Object, value: new PromiseResolver()},
},
/** @private {?number} */
navigationListener_: null,
/** @override */
......
......@@ -5,8 +5,8 @@
<dom-module id="activity-log-item">
<template>
<style include="iron-flex cr-shared-style">
#main {
min-height: 0;
:host {
display: block;
padding: 16px 20px;
}
......@@ -16,22 +16,20 @@
#api-call {
flex-grow: 1;
margin-left: 10px;
margin-inline-start: 10px;
}
#page-url-link {
margin-left: 16px;
margin-inline-start: 16px;
}
</style>
<div id="main">
<div id="activity-call-and-count" class="layout horizontal">
<span id="activity-type">[[data.activityType]]</span>
<span id="api-call">[[data.apiCall]]</span>
<span id="activity-count">[[data.count]]</span>
</div>
<div id="page-url" hidden$="[[!data.pageUrl]]">
<a id="page-url-link" href="[[data.pageUrl]]">[[data.pageUrl]]</a>
</div>
<div id="activity-call-and-count" class="layout horizontal">
<span id="activity-type">[[data.activityType]]</span>
<span id="api-call">[[data.apiCall]]</span>
<span id="activity-count">[[data.count]]</span>
</div>
<div id="page-url" hidden$="[[!data.pageUrl]]">
<a id="page-url-link" href="[[data.pageUrl]]">[[data.pageUrl]]</a>
</div>
</template>
<script src="activity_log_item.js"></script>
......
......@@ -376,15 +376,15 @@
</template>
</div>
</template>
<cr-link-row class="hr" is="" id="extensions-options"
<cr-link-row class="hr" id="extensions-options"
disabled="[[!isEnabled_(data.state)]]"
hidden="[[!shouldShowOptionsLink_(data.*)]]"
icon-class="icon-external" label="$i18n{itemOptions}"
on-click="onExtensionOptionsTap_">
</cr-link-row>
<cr-link-row class="hr" is="" id="extensions-activity-log-link"
hidden$="[[!showActivityLog]]" label="$i18n{viewActivityLog}"
on-click="onActivityLogTap_">
<cr-link-row class="hr" icon-class="subpage-arrow"
id="extensions-activity-log-link" hidden$="[[!showActivityLog]]"
label="$i18n{viewActivityLog}" on-click="onActivityLogTap_">
</cr-link-row>
<cr-link-row class="hr" hidden="[[!data.manifestHomePageUrl.length]]"
icon-class="icon-external" id="extensionWebsite"
......
......@@ -97,7 +97,6 @@ cr.define('extensions', function() {
/**
* The id of the item for the activity log view subpage.
* See also errorPageItem_.
* @private {!string|undefined}
*/
activityLogItemId_: String,
......
......@@ -329,9 +329,7 @@ cr.define('extensions', function() {
/** @override */
requestFileSource(args) {
return new Promise(function(resolve, reject) {
chrome.developerPrivate.requestFileSource(args, function(code) {
resolve(code);
});
chrome.developerPrivate.requestFileSource(args, resolve);
});
}
......@@ -349,9 +347,7 @@ cr.define('extensions', function() {
chrome.activityLogPrivate.ExtensionActivityFilter.ANY,
extensionId: extensionId
},
function(result) {
resolve(result);
});
resolve);
});
}
}
......
......@@ -11,6 +11,7 @@
.page-content {
@apply --cr-card-elevation;
background-color: white;
box-sizing: border-box;
margin: auto;
min-height: 100%;
padding-bottom: 64px;
......
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