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

Side by Side 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, 2 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <link rel="import" href="chrome://resources/html/action_link.html"> 1 <link rel="import" href="chrome://resources/html/action_link.html">
2 <link rel="import" href="chrome://resources/html/cr.html"> 2 <link rel="import" href="chrome://resources/html/cr.html">
3 <link rel="import" href="chrome://resources/html/load_time_data.html"> 3 <link rel="import" href="chrome://resources/html/load_time_data.html">
4 <link rel="import" href="chrome://resources/polymer/v1_0/polymer/polymer.html"> 4 <link rel="import" href="chrome://resources/polymer/v1_0/polymer/polymer.html">
5 <link rel="import" href="chrome://resources/polymer/v1_0/paper-button/paper-butt on.html"> 5 <link rel="import" href="chrome://resources/polymer/v1_0/paper-button/paper-butt on.html">
6 <link rel="import" href="chrome://resources/polymer/v1_0/paper-material/paper-ma terial.html"> 6 <link rel="import" href="chrome://resources/polymer/v1_0/paper-material/paper-ma terial.html">
7 <link rel="import" href="chrome://resources/polymer/v1_0/paper-progress/paper-pr ogress.html"> 7 <link rel="import" href="chrome://resources/polymer/v1_0/paper-progress/paper-pr ogress.html">
8 <link rel="import" href="chrome://downloads/action_service.html"> 8 <link rel="import" href="chrome://downloads/action_service.html">
9 <link rel="import" href="chrome://downloads/constants.html"> 9 <link rel="import" href="chrome://downloads/constants.html">
10 <link rel="import" href="chrome://downloads/throttled_icon_loader.html"> 10 <link rel="import" href="chrome://downloads/throttled_icon_loader.html">
11 11
12 <dom-module id="downloads-item"> 12 <dom-module id="downloads-item">
13 <template> 13 <template>
14 <template is="dom-if" if="[[!hideDate]]"> 14 <h3 id="date" hidden$="[[hideDate]]">[[computeDate_(data_.since_string, data _.date_string)]]</h3>
15 <h3 id="date">[[computeDate_(data_.since_string, data_.date_string)]]</h3>
16 </template>
17 15
18 <paper-material id="content" on-dragstart="onDragStart_" 16 <paper-material id="content" on-dragstart="onDragStart_"
19 elevation$="[[computeElevation_(isActive_)]]" 17 elevation$="[[computeElevation_(isActive_)]]"
20 class$="[[computeClass_(isActive_, isDangerous_, showProgress_)]]"> 18 class$="[[computeClass_(isActive_, isDangerous_, showProgress_)]]">
21 <div id="file-icon-wrapper" class="icon-wrapper"> 19 <div id="file-icon-wrapper" class="icon-wrapper">
22 <img class="icon" id="file-icon" alt="" hidden$="[[isDangerous_]]"> 20 <img class="icon" id="file-icon" alt="" hidden$="[[isDangerous_]]">
23 <div class="icon" id="warning" hidden$="[[!isDangerous_]]"></div> 21 <div class="icon" id="warning" hidden$="[[!isDangerous_]]"></div>
24 </div> 22 </div>
25 23
26 <div id="details"> 24 <div id="details">
27 <div id="title-area"><!-- 25 <div id="title-area"><!--
28 Can't have any line breaks. 26 Can't have any line breaks.
29 --><a is="action-link" id="file-link" href$="[[data_.url]]" 27 --><a is="action-link" id="file-link" href$="[[data_.url]]"
30 on-click="onFileLinkClick_" 28 on-click="onFileLinkClick_"
31 hidden$="[[!completelyOnDisk_]]">[[data_.file_name]]</a><!-- 29 hidden$="[[!completelyOnDisk_]]">[[data_.file_name]]</a><!--
32 Before #name. 30 Before #name.
33 --><span id="name" 31 --><span id="name"
34 hidden$="[[completelyOnDisk_]]">[[data_.file_name]]</span> 32 hidden$="[[completelyOnDisk_]]">[[data_.file_name]]</span>
35 <span id="tag">[[computeTag_(data_.state, data_.last_reason_text, data _.file_externally_removed)]]</span> 33 <span id="tag">[[computeTag_(data_.state, data_.last_reason_text, data _.file_externally_removed)]]</span>
36 </div> 34 </div>
37 35
38 <a id="url" target="_blank" href$="[[data_.url]]">[[data_.url]]</a> 36 <a id="url" target="_blank" href$="[[data_.url]]">[[data_.url]]</a>
39 37
40 <div id="description">[[computeDescription_(data_.state, data_.danger_ty pe, data_.file_name, data_.progress_status_text)]]</div> 38 <div id="description">[[computeDescription_(data_.state, data_.danger_ty pe, data_.file_name, data_.progress_status_text)]]</div>
41 39
42 <template is="dom-if" if="[[showProgress_]]"> 40 <paper-progress id="progress" hidden$="[[!showProgress_]]"
43 <paper-progress id="progress" 41 indeterminate$="[[isIndeterminate_(data_.percent)]]"
44 indeterminate$="[[isIndeterminate_(data_.percent)]]" 42 value$="[[data_.percent]]"></paper-progress>
45 value$="[[data_.percent]]"></paper-progress>
46 </template>
47 43
48 <div id="safe" class="controls" hidden$="[[isDangerous_]]"> 44 <div id="safe" class="controls" hidden$="[[isDangerous_]]">
49 <a is="action-link" id="show" i18n-content="controlShowInFolder" 45 <a is="action-link" id="show" i18n-content="controlShowInFolder"
50 on-click="onShowClick_" hidden$="[[!completelyOnDisk_]]"></a> 46 on-click="onShowClick_" hidden$="[[!completelyOnDisk_]]"></a>
51 <template is="dom-if" if="[[data_.retry]]"> 47 <template is="dom-if" if="[[!completelyOnDisk_]]">
52 <paper-button id="retry" 48 <paper-button id="retry" hidden$="[[!data_.retry]]"
53 on-click="onRetryClick_">[[i18n_.retry]]</paper-button> 49 on-click="onRetryClick_">[[i18n_.retry]]</paper-button>
54 </template> 50 <paper-button id="pause" hidden$="[[!isInProgress_]]"
55 <template is="dom-if" if="[[isInProgress_]]">
56 <paper-button id="pause"
57 on-click="onPauseClick_">[[i18n_.pause]]</paper-button> 51 on-click="onPauseClick_">[[i18n_.pause]]</paper-button>
58 </template> 52 <paper-button id="resume" hidden$="[[!data_.resume]]"
59 <template is="dom-if" if="[[data_.resume]]">
60 <paper-button id="resume"
61 on-click="onResumeClick_">[[i18n_.resume]]</paper-button> 53 on-click="onResumeClick_">[[i18n_.resume]]</paper-button>
62 </template> 54 <paper-button id="cancel" hidden$="[[!showCancel_]]"
63 <template is="dom-if" if="[[showCancel_]]">
64 <paper-button id="cancel"
65 on-click="onCancelClick_">[[i18n_.cancel]]</paper-button> 55 on-click="onCancelClick_">[[i18n_.cancel]]</paper-button>
66 </template> 56 </template>
67 <span id="controlled-by"><!-- Text populated dynamically. --></span> 57 <span id="controlled-by"><!-- Text populated dynamically. --></span>
68 </div> 58 </div>
69 59
70 <template is="dom-if" if="[[isDangerous_]]"> 60 <template is="dom-if" if="[[isDangerous_]]">
71 <div id="dangerous" class="controls"> 61 <div id="dangerous" class="controls">
72 <!-- Dangerous file types (e.g. .exe, .jar). --> 62 <!-- Dangerous file types (e.g. .exe, .jar). -->
73 <template is="dom-if" if="[[!isMalware_]]"> 63 <paper-button id="discard" on-click="onDiscardDangerous_"
74 <paper-button id="discard" on-click="onDiscardDangerous_" 64 class="discard" hidden$="[[isMalware_]]">[[i18n_.discard]]</pape r-button>
75 class="discard">[[i18n_.discard]]</paper-button> 65 <paper-button id="save" on-click="onSaveDangerous_"
76 <paper-button id="save" on-click="onSaveDangerous_" 66 class="keep" hidden$="[[isMalware_]]">[[i18n_.save]]</paper-butt on>
77 class="keep">[[i18n_.save]]</paper-button>
78 </template>
79 67
80 <!-- Things that safe browsing has determined to be dangerous. --> 68 <!-- Things that safe browsing has determined to be dangerous. -->
81 <template is="dom-if" if="[[isMalware_]]"> 69 <paper-button id="danger-remove" on-click="onDiscardDangerous_"
82 <paper-button id="danger-remove" on-click="onDiscardDangerous_" 70 class="discard" hidden$="[[!isMalware_]]">[[i18n_.remove]]</pape r-button>
83 class="discard">[[i18n_.remove]]</paper-button> 71 <paper-button id="restore" on-click="onSaveDangerous_"
84 <paper-button id="restore" on-click="onSaveDangerous_" 72 class="keep" hidden$="[[!isMalware_]]">[[i18n_.restore]</paper-b utton>
85 class="keep">[[i18n_.restore]</paper-button>
86 </template>
87 </div> 73 </div>
88 </template> 74 </template>
89 </div> 75 </div>
90 76
91 <div id="remove-wrapper" class="icon-wrapper"> 77 <div id="remove-wrapper" class="icon-wrapper">
92 <paper-icon-button id="remove" icon="clear" 78 <paper-icon-button id="remove" icon="clear"
93 i18n-values="title:controlRemoveFromList" 79 i18n-values="title:controlRemoveFromList"
94 style$="[[computeRemoveStyle_(isDangerous_, showCancel_)]]" 80 style$="[[computeRemoveStyle_(isDangerous_, showCancel_)]]"
95 on-click="onRemoveClick_"></paper-icon-button> 81 on-click="onRemoveClick_"></paper-icon-button>
96 </div> 82 </div>
97 83
98 <div id="incognito" i18n-values="title:inIncognito" 84 <div id="incognito" i18n-values="title:inIncognito"
99 hidden$="[[!data_.otr]]"></div> 85 hidden$="[[!data_.otr]]"></div>
100 </paper-material> 86 </paper-material>
101 87
102 </template> 88 </template>
103 <link rel="import" type="css" href="chrome://resources/css/action_link.css"> 89 <link rel="import" type="css" href="chrome://resources/css/action_link.css">
104 <link rel="import" type="css" href="chrome://downloads/shared_style.css"> 90 <link rel="import" type="css" href="chrome://downloads/shared_style.css">
105 <link rel="import" type="css" href="chrome://downloads/item.css"> 91 <link rel="import" type="css" href="chrome://downloads/item.css">
106 <script src="chrome://downloads/item.js"></script> 92 <script src="chrome://downloads/item.js"></script>
107 </dom-module> 93 </dom-module>
OLDNEW
« 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