// Copyright 2026 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
/**
 * @fileoverview
 * 'settings-keyboard-shortcut-page' is the settings page containing
 * the keyboard shortcut setting.
 */
import 'chrome://resources/cr_elements/cr_shared_style.css.js';
import 'chrome://resources/cr_elements/cr_shared_vars.css.js';
import '../settings_page/settings_section.js';
import '../settings_shared.css.js';
import '../controls/settings_dropdown_menu.js';
import { PolymerElement } from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js';
import { loadTimeData } from '../i18n_setup.js';
import { getTemplate } from './keyboard_shortcut_page.html.js';
import { SearchEnginesBrowserProxyImpl, SearchEnginesInteractions } from './search_engines_browser_proxy.js';
export class KeyboardShortcutPageElement extends PolymerElement {
    static get is() {
        return 'settings-keyboard-shortcut-page';
    }
    static get template() {
        return getTemplate();
    }
    static get properties() {
        return {
            keyboardShortcutMenuOptions_: {
                readOnly: true,
                type: Array,
                value() {
                    return [
                        {
                            value: 'true',
                            name: loadTimeData.getString('searchEnginesKeyboardShortcutsSpaceOrTab'),
                        },
                        {
                            value: 'false',
                            name: loadTimeData.getString('searchEnginesKeyboardShortcutsTab'),
                        },
                    ];
                },
            },
        };
    }
    onKeyboardShortcutSettingChange_() {
        const spaceEnabled = this.$.dropdown.getSelectedValue() === 'true';
        SearchEnginesBrowserProxyImpl.getInstance()
            .recordSearchEnginesPageHistogram(spaceEnabled ?
            SearchEnginesInteractions.KEYBOARD_SHORTCUT_SPACE_OR_TAB :
            SearchEnginesInteractions.KEYBOARD_SHORTCUT_TAB);
    }
}
customElements.define(KeyboardShortcutPageElement.is, KeyboardShortcutPageElement);
