Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 <link rel="import" href="chrome://resources/cr_elements/icons.html"> | |
| 2 <link rel="import" href="chrome://resources/html/polymer.html"> | |
| 3 <link rel="import" href="chrome://resources/html/web_ui_listener_behavior.html"> | |
| 4 <link rel="import" href="chrome://resources/polymer/v1_0/paper-progress/paper-pr ogress.html"> | |
|
michaelpg
2016/10/03 23:44:45
import iron-icon
fukino
2016/10/04 09:03:53
Done.
| |
| 5 <link rel="import" href="/device_page/drive_cache_dialog.html"> | |
| 6 <link rel="import" href="/prefs/prefs.html"> | |
| 7 <link rel="import" href="/route.html"> | |
| 8 <link rel="import" href="/settings_shared_css.html"> | |
| 9 | |
| 10 <dom-module id="settings-storage"> | |
| 11 <template> | |
| 12 <style include="settings-shared"> | |
| 13 progress { | |
| 14 -webkit-appearance: none; | |
| 15 display: block; | |
| 16 height: 40px; | |
| 17 width: 100%; | |
| 18 } | |
| 19 | |
| 20 progress::-webkit-progress-bar { | |
| 21 background-color: rgb(232, 232, 232); | |
| 22 border-radius: 2px; | |
| 23 } | |
| 24 | |
| 25 progress::-webkit-progress-value { | |
| 26 background-color: rgb(167, 225, 251); | |
| 27 border-radius: 2px; | |
| 28 } | |
| 29 | |
| 30 progress.space-low::-webkit-progress-value { | |
| 31 background-color: rgb(255, 176, 0); | |
| 32 } | |
| 33 | |
| 34 progress.space-critically-low::-webkit-progress-value { | |
| 35 background-color: var(--google-red-500); | |
| 36 } | |
| 37 | |
| 38 iron-icon { | |
| 39 --iron-icon-fill-color: rgb(255, 176, 0); | |
| 40 --iron-icon-height: 20px; | |
| 41 --iron-icon-width: 20px; | |
| 42 } | |
| 43 | |
| 44 #criticallyLowMessage iron-icon { | |
| 45 --iron-icon-fill-color: var(--google-red-500); | |
| 46 } | |
| 47 | |
| 48 .storage-size { | |
| 49 color: rgb(145, 145, 145); | |
| 50 } | |
| 51 | |
| 52 .message-area { | |
| 53 background-color: var(--google-grey-100); | |
| 54 border-radius: 2px; | |
| 55 margin: 10px 0; | |
| 56 padding: 20px 20px 6px; | |
| 57 width: 100%; | |
| 58 } | |
| 59 | |
| 60 .message-title { | |
| 61 align-items: center; | |
| 62 display: flex; | |
| 63 margin-bottom: 16px; | |
| 64 } | |
| 65 | |
| 66 .message-title span { | |
| 67 font-size: 115%; | |
| 68 margin: 0 10px; | |
| 69 } | |
| 70 | |
| 71 .message-area p { | |
| 72 color: rgb(90, 90, 90); | |
| 73 } | |
| 74 | |
| 75 #barArea { | |
| 76 display: flex; | |
| 77 flex-direction: column; | |
| 78 margin: 12px 0 20px; | |
| 79 width: 100%; | |
| 80 } | |
| 81 | |
| 82 #barLabels { | |
| 83 display: flex; | |
| 84 } | |
| 85 | |
| 86 .bar-label { | |
| 87 display: flex; | |
| 88 flex-direction: column; | |
| 89 } | |
| 90 | |
| 91 .bar-label .vertical-line { | |
| 92 align-self: center; | |
| 93 background-color: rgb(223, 223, 223); | |
| 94 height: 10px; | |
| 95 width: 1px; | |
| 96 } | |
| 97 | |
| 98 .bar-label span { | |
| 99 font-size: 85%; | |
| 100 } | |
| 101 | |
| 102 .bar-label .wrapper { | |
| 103 text-align: center; | |
| 104 white-space: nowrap; | |
| 105 } | |
| 106 | |
| 107 /* If the "Available" part in the ber is too small, the label "Available" | |
| 108 * and a label for its size can overstep the right edge of bar area. | |
| 109 * To prevent it, we invert the direction to put the text labels here. | |
| 110 * We restore the direction for inner span elements not to change how to | |
| 111 * render the text contents. */ | |
| 112 .end-aligned .wrapper { | |
| 113 direction: rtl; | |
| 114 } | |
| 115 | |
| 116 :host-context([dir=rtl]) .end-aligned .wrapper { | |
| 117 direction: ltr; | |
| 118 } | |
| 119 | |
| 120 .end-aligned .wrapper span { | |
| 121 direction: initial; | |
| 122 unicode-bidi: embed; | |
| 123 } | |
| 124 </style> | |
| 125 <div class="settings-box first" | |
| 126 hidden$="[[!isSpaceLow_(sizeStat_.spaceState)]]"> | |
| 127 <div class="message-area"> | |
| 128 <div class="message-title"> | |
| 129 <iron-icon icon="cr:warning"></iron-icon> | |
| 130 <span>$i18n{storageSpaceLowMessageTitle}</span> | |
| 131 </div> | |
| 132 <p>$i18n{storageSpaceLowMessageLine1}</p> | |
|
michaelpg
2016/10/03 23:44:45
do we use <p> anywhere else? it has user-agent sty
fukino
2016/10/04 09:03:53
I replaced these <p>s with <div>s, and set the sam
| |
| 133 <p>$i18n{storageSpaceLowMessageLine2}</p> | |
| 134 </div> | |
| 135 </div> | |
| 136 <div class="settings-box first" | |
| 137 hidden$="[[!isSpaceCriticallyLow_(sizeStat_.spaceState)]]"> | |
| 138 <div id="criticallyLowMessage" class="message-area"> | |
| 139 <div class="message-title"> | |
| 140 <iron-icon icon="cr:warning"></iron-icon> | |
| 141 <span>$i18n{storageSpaceCriticallyLowMessageTitle}</span> | |
| 142 </div> | |
| 143 <p>$i18n{storageSpaceCriticallyLowMessageLine1}</p> | |
|
michaelpg
2016/10/03 23:44:45
same
fukino
2016/10/04 09:03:53
Done.
| |
| 144 <p>$i18n{storageSpaceCriticallyLowMessageLine2}</p> | |
| 145 </div> | |
| 146 </div> | |
| 147 <div class="settings-box first"> | |
| 148 <div id="barArea"> | |
| 149 <progress id="bar" class$="[[getBarClass_(sizeStat_.spaceState)]]" | |
| 150 value="[[sizeStat_.usedRatio]]"></progress> | |
| 151 <div id="barLabels"> | |
| 152 <div id="inUseLabelArea" class="bar-label"> | |
| 153 <div class="vertical-line"></div> | |
| 154 <div class="wrapper"><span>$i18n{storageItemInUse}</span></div> | |
| 155 <div class="wrapper"> | |
| 156 <span class="storage-size">[[sizeStat_.usedSize]]</span> | |
| 157 </div> | |
| 158 </div> | |
| 159 <div id="availableLabelArea" class="bar-label end-aligned"> | |
| 160 <div class="vertical-line"></div> | |
| 161 <div class="wrapper"><span>$i18n{storageItemAvailable}</span></div> | |
| 162 <div class="wrapper"> | |
| 163 <span class="storage-size">[[sizeStat_.availableSize]]</span> | |
| 164 </div> | |
| 165 </div> | |
| 166 </div> | |
| 167 </div> | |
| 168 </div> | |
| 169 <div class="settings-box" on-tap="onDownloadsTap_" actionable> | |
| 170 <div class="start">$i18n{storageItemDownloads}</div> | |
| 171 <div id="downloadsSize" class="storage-size"> | |
| 172 $i18n{storageSizeComputing} | |
| 173 </div> | |
| 174 </div> | |
| 175 <div class="settings-box" on-tap="onDriveCacheTap_" | |
| 176 hidden$="[[!driveEnabled_]]" actionable> | |
| 177 <div class="start">$i18n{storageItemDriveCache}</div> | |
| 178 <div id="driveCacheSize" class="storage-size"> | |
| 179 $i18n{storageSizeComputing} | |
| 180 </div> | |
| 181 </div> | |
| 182 <div class="settings-box" on-tap="onBrowsingDataTap_" actionable> | |
| 183 <div class="start">$i18n{storageItemBrowsingData}</div> | |
| 184 <div id="browsingDataSize" class="storage-size"> | |
| 185 $i18n{storageSizeComputing} | |
| 186 </div> | |
| 187 </div> | |
| 188 <div class="settings-box" on-tap="onAndroidTap_" | |
| 189 hidden$="[[!androidEnabled_]]" actionable> | |
| 190 <div class="start">$i18n{storageItemAndroid}</div> | |
| 191 <div id="androidSize" class="storage-size"> | |
| 192 $i18n{storageSizeComputing} | |
| 193 </div> | |
| 194 </div> | |
| 195 <div class="settings-box" on-tap="onOtherUsersTap_" actionable> | |
| 196 <div class="start">$i18n{storageItemOtherUsers}</div> | |
| 197 <div id="otherUsersSize" class="storage-size"> | |
| 198 $i18n{storageSizeComputing} | |
| 199 </div> | |
| 200 </div> | |
| 201 <settings-drive-cache-dialog id="storageDriveCache"> | |
| 202 </settings-drive-cache-dialog> | |
| 203 </template> | |
| 204 <script src="storage.js"></script> | |
|
michaelpg
2016/10/03 23:44:45
use absolute paths: /device_page/storage.js
fukino
2016/10/04 09:03:53
Done.
| |
| 205 </dom-module> | |
| OLD | NEW |