Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / chrome / browser / resources / md_downloads / item.html
blob73d8db3ff34e9e15d4bfeca855f2292a33be3d19
1 <link rel="import" href="chrome://resources/html/action_link.html">
2 <link rel="import" href="chrome://resources/html/cr.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">
5 <link rel="import" href="chrome://resources/polymer/v1_0/paper-button/paper-button.html">
6 <link rel="import" href="chrome://resources/polymer/v1_0/paper-material/paper-material.html">
7 <link rel="import" href="chrome://resources/polymer/v1_0/paper-progress/paper-progress.html">
8 <link rel="import" href="chrome://downloads/action_service.html">
9 <link rel="import" href="chrome://downloads/constants.html">
10 <link rel="import" href="chrome://downloads/throttled_icon_loader.html">
12 <dom-module id="downloads-item">
13 <template>
14 <template is="dom-if" if="[[!hideDate]]">
15 <h3 id="date">[[computeDate_(data_.since_string, data_.date_string)]]</h3>
16 </template>
18 <paper-material id="content" on-dragstart="onDragStart_"
19 elevation$="[[computeElevation_(isActive_)]]"
20 class$="[[computeClass_(isActive_, isDangerous_, showProgress_)]]">
21 <div id="file-icon-wrapper" class="icon-wrapper">
22 <img class="icon" id="file-icon" alt="" hidden$="[[isDangerous_]]">
23 <div class="icon" id="warning" hidden$="[[!isDangerous_]]"></div>
24 </div>
26 <div id="details">
27 <div id="title-area"><!--
28 Can't have any line breaks.
29 --><a is="action-link" id="file-link" href$="[[data_.url]]"
30 on-click="onFileLinkClick_"
31 hidden$="[[!completelyOnDisk_]]">[[data_.file_name]]</a><!--
32 Before #name.
33 --><span id="name"
34 hidden$="[[completelyOnDisk_]]">[[data_.file_name]]</span>
35 <span id="tag">[[computeTag_(data_.state, data_.last_reason_text, data_.file_externally_removed)]]</span>
36 </div>
38 <a id="url" target="_blank" href$="[[data_.url]]">[[data_.url]]</a>
40 <div id="description">[[computeDescription_(data_.state, data_.danger_type, data_.file_name, data_.progress_status_text)]]</div>
42 <template is="dom-if" if="[[showProgress_]]">
43 <paper-progress id="progress"
44 indeterminate$="[[isIndeterminate_(data_.percent)]]"
45 value$="[[data_.percent]]"></paper-progress>
46 </template>
48 <div id="safe" class="controls" hidden$="[[isDangerous_]]">
49 <template is="dom-if" if="[[completelyOnDisk_]]">
50 <paper-button id="show" on-click="onShowClick_"
51 lowercase noink>[[i18n_.show]]</paper-button>
52 </template>
53 <template is="dom-if" if="[[data_.retry]]">
54 <paper-button id="retry"
55 on-click="onRetryClick_">[[i18n_.retry]]</paper-button>
56 </template>
57 <template is="dom-if" if="[[isInProgress_]]">
58 <paper-button id="pause"
59 on-click="onPauseClick_">[[i18n_.pause]]</paper-button>
60 </template>
61 <template is="dom-if" if="[[data_.resume]]">
62 <paper-button id="resume"
63 on-click="onResumeClick_">[[i18n_.resume]]</paper-button>
64 </template>
65 <template is="dom-if" if="[[showCancel_]]">
66 <paper-button id="cancel"
67 on-click="onCancelClick_">[[i18n_.cancel]]</paper-button>
68 </template>
69 <span id="controlled-by"><!-- Text populated dynamically. --></span>
70 </div>
72 <template is="dom-if" if="[[isDangerous_]]">
73 <div id="dangerous" class="controls">
74 <!-- Dangerous file types (e.g. .exe, .jar). -->
75 <template is="dom-if" if="[[!isMalware_]]">
76 <paper-button id="discard" on-click="onDiscardDangerous_"
77 class="discard">[[i18n_.discard]]</paper-button>
78 <paper-button id="save" on-click="onSaveDangerous_"
79 class="keep">[[i18n_.save]]</paper-button>
80 </template>
82 <!-- Things that safe browsing has determined to be dangerous. -->
83 <template is="dom-if" if="[[isMalware_]]">
84 <paper-button id="danger-remove" on-click="onDiscardDangerous_"
85 class="discard">[[i18n_.remove]]</paper-button>
86 <paper-button id="restore" on-click="onSaveDangerous_"
87 class="keep">[[i18n_.restore]</paper-button>
88 </template>
89 </div>
90 </template>
91 </div>
93 <div id="remove-wrapper" class="icon-wrapper">
94 <paper-icon-button id="remove" icon="clear"
95 i18n-values="title:controlRemoveFromList"
96 style$="[[computeRemoveStyle_(isDangerous_, showCancel_)]]"
97 on-click="onRemoveClick_"></paper-icon-button>
98 </div>
100 <div id="incognito" i18n-values="title:inIncognito"
101 hidden$="[[!data_.otr]]"></div>
102 </paper-material>
104 </template>
105 <link rel="import" type="css" href="chrome://resources/css/action_link.css">
106 <link rel="import" type="css" href="chrome://downloads/shared_style.css">
107 <link rel="import" type="css" href="chrome://downloads/item.css">
108 <script src="chrome://downloads/item.js"></script>
109 </dom-module>