| // Copyright 2024 The Chromium Authors | |
| // Use of this source code is governed by a BSD-style license that can be | |
| // found in the LICENSE file. | |
| import {html} from '//resources/lit/v3_0/lit.rollup.js'; | |
| import type {AppElement} from './app.js'; | |
| export function getHtml(this: AppElement) { | |
| return html`<!--_html_template_start_--> | |
| <div id="header"> | |
| <div class="flex-container"> | |
| <div class="flex search-container"> | |
| <input type="text" id="search" aria-label="$i18n{search-label}" | |
| placeholder="$i18n{search-placeholder}" autocomplete="off" | |
| spellcheck="false" @input="${this.onSearchInput_}"> | |
| <button class="clear-search" title="$i18n{clear-search}" | |
| @click="${this.onClearSearchClick_}"> | |
| <div class="clear-search-icon"></div> | |
| </button> | |
| </div> | |
| <div class="flex actions-container"> | |
| <cr-button id="experiment-reset-all" @click="${this.onResetAllClick_}" | |
| @keydown="${this.onResetAllKeydown_}" @blur="${this.onResetAllBlur_}"> | |
| $i18n{reset} | |
| </cr-button> | |
| <cr-icon-button id="experiment-import" | |
| iron-icon="${this.webuiRoundedIconsEnabled_ ? | |
| 'flags:upload' : | |
| 'flags:file-upload-old'}" | |
| aria-label="Import" @click="${this.onImportClick_}" | |
| ?hidden="${!this.isImportExportEnabled_}"> | |
| </cr-icon-button> | |
| <cr-tooltip for="experiment-import" fit-to-visible-bounds | |
| ?hidden="${!this.isImportExportEnabled_}"> | |
| Import | |
| </cr-tooltip> | |
| <cr-action-menu id="import-menu"> | |
| <button id="import-from-file" class="dropdown-item" | |
| @click="${this.onImportFromFileClick_}"> | |
| Upload file | |
| </button> | |
| <button id="import-from-clipboard" class="dropdown-item" | |
| @click="${this.onImportFromClipboardClick_}"> | |
| Paste from clipboard | |
| </button> | |
| </cr-action-menu> | |
| <cr-icon-button id="experiment-export" iron-icon="cr:download" | |
| aria-label="Export" @click="${this.onExportClick_}" | |
| ?hidden="${!this.isImportExportEnabled_}"> | |
| </cr-icon-button> | |
| <cr-tooltip for="experiment-export" fit-to-visible-bounds | |
| ?hidden="${!this.isImportExportEnabled_}"> | |
| Export | |
| </cr-tooltip> | |
| <input type="file" id="import-file-input" accept=".json" | |
| @change="${this.onImportFileChange_}" hidden> | |
| </div> | |
| </div> | |
| <div class="screen-reader-only" id="screen-reader-status-message" | |
| role="status"> | |
| </div> | |
| <cr-toast id="toast" duration="3000"> | |
| <div>${this.toastMessage_}</div> | |
| </cr-toast> | |
| <cr-toast id="errorToast" duration="3000"> | |
| <div>${this.importError}</div> | |
| </cr-toast> | |
| </div> | |
| <div id="body-container"> | |
| <div id="flagsTemplate"> | |
| <div class="flex-container"> | |
| <div class="flex"> | |
| <h1 class="section-header-title">$i18n{heading}</h1> | |
| </div> | |
| <span id="version" class="flex">$i18n{version}</span> | |
| </div> | |
| <div class="blurb-container"> | |
| <span class="blurb-warning">$i18n{page-warning}</span> | |
| <span>$i18n{page-warning-explanation}</span> | |
| <if expr="is_chromeos"> | |
| <p id="owner-warning" ?hidden="${!this.data.showOwnerWarning}"> | |
| $i18n{owner-warning} | |
| </p> | |
| </if> | |
| </div> | |
| <p id="promos" ?hidden="${!this.shouldShowPromos_()}"> | |
| <!-- Those strings are not localized because they only | |
| appear in chrome://flags, which is not localized. --> | |
| <span id="channel-promo-beta" | |
| ?hidden="${!this.data.showBetaChannelPromotion}"> | |
| Interested in cool new Chrome features? Try our | |
| <a href="https://chrome.com/beta">beta channel</a>. | |
| </span> | |
| <span id="channel-promo-dev" | |
| ?hidden="${this.data.showDevChannelPromotion}"> | |
| Interested in cool new Chrome features? Try our | |
| <a href="https://chrome.com/dev">dev channel</a> | |
| </span> | |
| </p> | |
| <cr-tabs id="tabs" .tabNames="${this.tabNames_}" | |
| .selected="${this.selectedTabIndex_}" | |
| @selected-changed="${this.onTabsSelectedChanged_}"> | |
| </cr-tabs> | |
| <div id="tabpanels"> | |
| <div id="tab-content-available" class="tab-content" | |
| ?selected="${this.isTabSelected_(0)}" role="tabpanel" | |
| aria-labelledby="tab-available" aria-hidden="false"> | |
| <!-- Non default experiments. --> | |
| <div id="non-default-experiments"> | |
| ${this.nonDefaultFeatures.map(item => html` | |
| <flags-experiment id="${item.internal_name}" .data="${item}" | |
| @select-change="${this.onSelectChange_}" | |
| @textarea-change="${this.onTextareaChange_}" | |
| @input-change="${this.onInputChange_}"> | |
| </flags-experiment> | |
| `)} | |
| </div> | |
| <!-- Experiments with default settings. --> | |
| <div id="default-experiments"> | |
| ${this.defaultFeatures.map(item => html` | |
| <flags-experiment id="${item.internal_name}" .data="${item}" | |
| @select-change="${this.onSelectChange_}" | |
| @textarea-change="${this.onTextareaChange_}" | |
| @input-change="${this.onInputChange_}"> | |
| </flags-experiment> | |
| `)} | |
| </div> | |
| <div class="no-match" role="alert" hidden>$i18n{no-results}</div> | |
| </div> | |
| <if expr="not is_ios"> | |
| <div id="tab-content-unavailable" class="tab-content" | |
| ?selected="${this.isTabSelected_(1)}" role="tabpanel" | |
| aria-labelledby="tab-unavailable" aria-hidden="false"> | |
| <div id="unavailable-experiments"> | |
| ${this.data.unsupportedFeatures.map(item => html` | |
| <flags-experiment id="${item.internal_name}" .data="${item}" | |
| unsupported> | |
| </flags-experiment> | |
| `)} | |
| </div> | |
| <div class="no-match" role="alert" hidden>$i18n{no-results}</div> | |
| </div> | |
| </if> | |
| </div> | |
| <div id="needs-restart" ?show="${this.needsRestart}" | |
| role="${this.getNeedsRestartRole_()}"> | |
| <div class="flex-container"> | |
| <div class="flex restart-notice">$i18n{flagsRestartNotice}</div> | |
| <div class="flex"> | |
| <if expr="not is_ios"> | |
| <cr-button id="experiment-restart-button" class="action-button" | |
| ?disabled="${!this.needsRestart}" | |
| @click="${this.onRestartButtonClick_}" | |
| @keydown="${this.onRestartButtonKeydown_}" | |
| @blur="${this.onRestartButtonBlur_}"> | |
| $i18n{relaunch} | |
| </cr-button> | |
| </if> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| <!--_html_template_end_-->`; | |
| } |