| <style include="action-link"> | |
| table { | |
| border-collapse: collapse; | |
| } | |
| table td, | |
| table th { | |
| border: 1px solid #777; | |
| padding-inline-end: 4px; | |
| padding-inline-start: 4px; | |
| } | |
| @media (prefers-color-scheme: dark) { | |
| table td, | |
| table th { | |
| border-color: var(--cr-separator-color); | |
| } | |
| } | |
| table th { | |
| background: rgb(224, 236, 255); | |
| padding-bottom: 4px; | |
| padding-inline-end: 16px; | |
| padding-top: 4px; | |
| white-space: nowrap; | |
| } | |
| @media (prefers-color-scheme: dark) { | |
| table th { | |
| background: var(--google-grey-800); | |
| } | |
| } | |
| table th[data-sort-key] { | |
| cursor: pointer; | |
| } | |
| table th div.header-cell-container { | |
| align-items: center; | |
| display: flex; | |
| justify-content: flex-start; | |
| } | |
| @media (prefers-color-scheme: dark) { | |
| table td { | |
| background-color: var(--google-grey-900); | |
| color: var(--cr-secondary-text-color); | |
| } | |
| } | |
| table td.title-cell { | |
| max-width: 200px; | |
| overflow: hidden; | |
| white-space: nowrap; | |
| } | |
| table td div.title-cell-container { | |
| align-items: center; | |
| display: flex; | |
| justify-content: flex-start; | |
| } | |
| table td div.favicon-div { | |
| height: 16px; | |
| margin: 3px; | |
| min-width: 16px; | |
| } | |
| table td div.title-div { | |
| overflow: hidden; | |
| white-space: nowrap; | |
| } | |
| table td.tab-url-cell { | |
| max-width: 200px; | |
| overflow: hidden; | |
| white-space: nowrap; | |
| } | |
| table td.visibility-cell { | |
| width: 6em; | |
| } | |
| table td.loading-state-cell { | |
| width: 6em; | |
| } | |
| table td.state-cell { | |
| width: 10em; | |
| } | |
| table td.boolean-cell, | |
| table td.discard-count-cell, | |
| table td.reactivation-score-cell, | |
| table td.site-engagement-score-cell, | |
| table td.utility-rank-cell { | |
| text-align: center; | |
| } | |
| table td div[is=action-link], | |
| table td.actions-cell { | |
| font-size: 0.6rem; | |
| } | |
| table tr:hover { | |
| background: rgb(255, 255, 187); | |
| } | |
| @media (prefers-color-scheme: dark) { | |
| table tr:hover td { | |
| background: var(--google-grey-800); | |
| } | |
| } | |
| th div.header-cell-container::after { | |
| content: '▲'; | |
| opacity: 0; | |
| } | |
| th.sort-column div.header-cell-container::after { | |
| content: '▲'; | |
| opacity: 1; | |
| } | |
| th.sort-column-reverse div.header-cell-container::after { | |
| content: '▼'; | |
| opacity: 1; | |
| } | |
| .tooltip-container { | |
| position: relative; | |
| } | |
| .tooltip { | |
| background: black; | |
| color: white; | |
| display: none; | |
| font-size: 0.75rem; | |
| left: 50%; | |
| margin-inline-start: -100px; | |
| margin-top: 4px; | |
| padding: 4px; | |
| position: absolute; | |
| top: 100%; | |
| width: 200px; | |
| z-index: 1; | |
| } | |
| .tooltip-container:hover > .tooltip { | |
| display: block; | |
| } | |
| </style> | |
| <div id="discards"> | |
| <div is="action-link" on-click="discardUrgentNow_"> | |
| [Urgent discard a tab now] | |
| </div> | |
| <div is="action-link" on-click="toggleHighEfficiencyMode_"> | |
| [Toggle high efficiency mode] | |
| </div> | |
| <div is="action-link" on-click="toggleBatterySaverMode_"> | |
| [Toggle battery saver mode] | |
| </div> | |
| <table id="tab-discard-info-table"> | |
| <thead > | |
| <tr id="tab-discards-info-table-header"> | |
| <th data-sort-key="utilityRank" class="sort-column" | |
| on-click="onSortClick"> | |
| <div class="header-cell-container"> | |
| <div> | |
| <div>Utility</div> | |
| <div>Rank<div> | |
| </div> | |
| </div> | |
| </th> | |
| <th data-sort-key="siteEngagementScore" on-click="onSortClick"> | |
| <div class="header-cell-container"> | |
| <div> | |
| <div>Site</div> | |
| <div>Engagement</div> | |
| <div>Score</div> | |
| </div> | |
| </div> | |
| </th> | |
| <th data-sort-key="title" on-click="onSortClick"> | |
| <div class="header-cell-container"> | |
| Tab Title | |
| </div> | |
| </th> | |
| <th data-sort-key="tabUrl" on-click="onSortClick"> | |
| <div class="header-cell-container"> | |
| Tab URL | |
| </div> | |
| </th> | |
| <th data-sort-key="visibility" on-click="onSortClick"> | |
| <div class="header-cell-container"> | |
| Visibility | |
| </div> | |
| </th> | |
| <th data-sort-key="loadingState" on-click="onSortClick"> | |
| <div class="header-cell-container"> | |
| Loading State | |
| </div> | |
| </th> | |
| <th data-sort-key="state" on-click="onSortClick"> | |
| <div class="header-cell-container"> | |
| <div> | |
| <div>Lifecycle</div> | |
| <div>State</div> | |
| </div> | |
| </div> | |
| </th> | |
| <th data-sort-key="discardCount" on-click="onSortClick"> | |
| <div class="header-cell-container"> | |
| <div> | |
| <div>Discard</div> | |
| <div>Count</div> | |
| </div> | |
| </div> | |
| </div></th> | |
| <th data-sort-key="isAutoDiscardable" on-click="onSortClick"> | |
| <div class="header-cell-container"> | |
| <div> | |
| <div>Auto</div> | |
| <div>Discardable</div> | |
| </div> | |
| </div> | |
| </th> | |
| <th data-sort-key="lastActiveSeconds" on-click="onSortClick"> | |
| <div class="header-cell-container"> | |
| Last Active | |
| </div> | |
| </th> | |
| <th> | |
| <div class="header-cell-container"> | |
| Actions | |
| </div> | |
| </th> | |
| </tr> | |
| </thead> | |
| <tbody id="tab-discards-info-table-body"> | |
| <template is="dom-repeat" | |
| sort="[[computeSortFunction_(sortKey, sortReverse)]]" | |
| items="[[tabInfos_]]"> | |
| <tr> | |
| <td>[[item.utilityRank]]</td> | |
| <td>[[getSiteEngagementScore_(item)]]</td> | |
| <td> | |
| <div class="title-cell-container"> | |
| <div class="favicon-div" | |
| style$="[[getFavIconStyle_(item)]];"></div> | |
| <div class="title-cell">[[item.title]]</div> | |
| </div> | |
| </td> | |
| <td class="tab-url-cell">[[item.tabUrl]]</td> | |
| <td>[[visibilityToString_(item.visibility)]]</td> | |
| <td>[[loadingStateToString_(item.loadingState)]]</td> | |
| <td>[[getLifeCycleState_(item)]]</td> | |
| <td>[[item.discardCount]]</td> | |
| <td class="boolean-cell"> | |
| <div>[[boolToString_(item.isAutoDiscardable)]]</div> | |
| <div is="action-link" class="is-auto-discardable-link" | |
| on-click="toggleAutoDiscardable_"> | |
| [Toggle] | |
| </div> | |
| </td> | |
| <td class="last-active-cell"> | |
| [[durationToString_(item.lastActiveSeconds)]] | |
| </td> | |
| <td class="actions-cell"> | |
| <div is="action-link" on-click="loadTab_" | |
| disabled$="[[!canLoad_(item)]]"> | |
| [Load]</div> | |
| <div is="action-link" on-click="urgentDiscardTab_" | |
| disabled$="[[!canDiscard_(item)]]"> | |
| [Urgent Discard] | |
| </div> | |
| </td> | |
| </tr> | |
| </template> | |
| </tbody> | |
| </table> | |
| </div> |