Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3683)

Unified Diff: chrome/browser/resources/md_downloads/item.html

Issue 1375123002: MD Downloads: reduce the amount of dom-ifs to speed Polymer up (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@md-dl-perf1
Patch Set: Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/md_downloads/item.html
diff --git a/chrome/browser/resources/md_downloads/item.html b/chrome/browser/resources/md_downloads/item.html
index 21ef72d157a25d435047ab2fe419551397a60ecb..109de2921bdb47c6337038fa0ee7369fc5716137 100644
--- a/chrome/browser/resources/md_downloads/item.html
+++ b/chrome/browser/resources/md_downloads/item.html
@@ -11,9 +11,7 @@
<dom-module id="downloads-item">
<template>
- <template is="dom-if" if="[[!hideDate]]">
- <h3 id="date">[[computeDate_(data_.since_string, data_.date_string)]]</h3>
- </template>
+ <h3 id="date" hidden$="[[hideDate]]">[[computeDate_(data_.since_string, data_.date_string)]]</h3>
<paper-material id="content" on-dragstart="onDragStart_"
elevation$="[[computeElevation_(isActive_)]]"
@@ -39,29 +37,21 @@
<div id="description">[[computeDescription_(data_.state, data_.danger_type, data_.file_name, data_.progress_status_text)]]</div>
- <template is="dom-if" if="[[showProgress_]]">
- <paper-progress id="progress"
- indeterminate$="[[isIndeterminate_(data_.percent)]]"
- value$="[[data_.percent]]"></paper-progress>
- </template>
+ <paper-progress id="progress" hidden$="[[!showProgress_]]"
+ indeterminate$="[[isIndeterminate_(data_.percent)]]"
+ value$="[[data_.percent]]"></paper-progress>
<div id="safe" class="controls" hidden$="[[isDangerous_]]">
<a is="action-link" id="show" i18n-content="controlShowInFolder"
on-click="onShowClick_" hidden$="[[!completelyOnDisk_]]"></a>
- <template is="dom-if" if="[[data_.retry]]">
- <paper-button id="retry"
+ <template is="dom-if" if="[[!completelyOnDisk_]]">
+ <paper-button id="retry" hidden$="[[!data_.retry]]"
on-click="onRetryClick_">[[i18n_.retry]]</paper-button>
- </template>
- <template is="dom-if" if="[[isInProgress_]]">
- <paper-button id="pause"
+ <paper-button id="pause" hidden$="[[!isInProgress_]]"
on-click="onPauseClick_">[[i18n_.pause]]</paper-button>
- </template>
- <template is="dom-if" if="[[data_.resume]]">
- <paper-button id="resume"
+ <paper-button id="resume" hidden$="[[!data_.resume]]"
on-click="onResumeClick_">[[i18n_.resume]]</paper-button>
- </template>
- <template is="dom-if" if="[[showCancel_]]">
- <paper-button id="cancel"
+ <paper-button id="cancel" hidden$="[[!showCancel_]]"
on-click="onCancelClick_">[[i18n_.cancel]]</paper-button>
</template>
<span id="controlled-by"><!-- Text populated dynamically. --></span>
@@ -70,20 +60,16 @@
<template is="dom-if" if="[[isDangerous_]]">
<div id="dangerous" class="controls">
<!-- Dangerous file types (e.g. .exe, .jar). -->
- <template is="dom-if" if="[[!isMalware_]]">
- <paper-button id="discard" on-click="onDiscardDangerous_"
- class="discard">[[i18n_.discard]]</paper-button>
- <paper-button id="save" on-click="onSaveDangerous_"
- class="keep">[[i18n_.save]]</paper-button>
- </template>
+ <paper-button id="discard" on-click="onDiscardDangerous_"
+ class="discard" hidden$="[[isMalware_]]">[[i18n_.discard]]</paper-button>
+ <paper-button id="save" on-click="onSaveDangerous_"
+ class="keep" hidden$="[[isMalware_]]">[[i18n_.save]]</paper-button>
<!-- Things that safe browsing has determined to be dangerous. -->
- <template is="dom-if" if="[[isMalware_]]">
- <paper-button id="danger-remove" on-click="onDiscardDangerous_"
- class="discard">[[i18n_.remove]]</paper-button>
- <paper-button id="restore" on-click="onSaveDangerous_"
- class="keep">[[i18n_.restore]</paper-button>
- </template>
+ <paper-button id="danger-remove" on-click="onDiscardDangerous_"
+ class="discard" hidden$="[[!isMalware_]]">[[i18n_.remove]]</paper-button>
+ <paper-button id="restore" on-click="onSaveDangerous_"
+ class="keep" hidden$="[[!isMalware_]]">[[i18n_.restore]</paper-button>
</div>
</template>
</div>
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698