// ui/webui/resources/js/browser_command/browser_command.mojom-webui.ts is auto generated by mojom_bindings_generator.py, do not edit
// Copyright 2020 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import { mojo } from '//resources/mojo/mojo/public/js/bindings.js';
export const CommandSpec = { $: mojo.internal.Enum() };
export var Command;
(function (Command) {
    Command[Command["MIN_VALUE"] = 0] = "MIN_VALUE";
    Command[Command["MAX_VALUE"] = 21] = "MAX_VALUE";
    Command[Command["kUnknownCommand"] = 0] = "kUnknownCommand";
    Command[Command["kOpenSafetyCheck"] = 1] = "kOpenSafetyCheck";
    Command[Command["kOpenSafeBrowsingEnhancedProtectionSettings"] = 2] = "kOpenSafeBrowsingEnhancedProtectionSettings";
    Command[Command["kOpenFeedbackForm"] = 3] = "kOpenFeedbackForm";
    Command[Command["kOpenPrivacyGuide"] = 4] = "kOpenPrivacyGuide";
    Command[Command["kStartTabGroupTutorial"] = 5] = "kStartTabGroupTutorial";
    Command[Command["kOpenPasswordManager"] = 6] = "kOpenPasswordManager";
    Command[Command["kNoOpCommand"] = 7] = "kNoOpCommand";
    Command[Command["kOpenPerformanceSettings"] = 8] = "kOpenPerformanceSettings";
    Command[Command["kOpenNTPAndStartCustomizeChromeTutorial"] = 9] = "kOpenNTPAndStartCustomizeChromeTutorial";
    Command[Command["kStartPasswordManagerTutorial"] = 10] = "kStartPasswordManagerTutorial";
    Command[Command["kStartSavedTabGroupTutorial"] = 11] = "kStartSavedTabGroupTutorial";
    Command[Command["kOpenAISettings"] = 12] = "kOpenAISettings";
    Command[Command["kOpenSafetyCheckFromWhatsNew"] = 13] = "kOpenSafetyCheckFromWhatsNew";
    Command[Command["kOpenPaymentsSettings"] = 14] = "kOpenPaymentsSettings";
    Command[Command["kOpenGlic"] = 16] = "kOpenGlic";
    Command[Command["kOpenGlicSettings"] = 17] = "kOpenGlicSettings";
    Command[Command["kPrewarmGlicFre"] = 18] = "kPrewarmGlicFre";
    Command[Command["kOpenSplitView"] = 19] = "kOpenSplitView";
    Command[Command["kEnableVerticalTabs"] = 21] = "kEnableVerticalTabs";
})(Command || (Command = {}));
export class CommandHandlerFactoryPendingReceiver {
    handle;
    constructor(handle) {
        this.handle = mojo.internal.interfaceSupport.getEndpointForReceiver(handle);
    }
    bindInBrowser(scope = 'context') {
        mojo.internal.interfaceSupport.bind(this.handle, 'browser_command.mojom.CommandHandlerFactory', scope);
    }
}
export class CommandHandlerFactoryRemote {
    proxy;
    $;
    onConnectionError;
    constructor(handle) {
        this.proxy =
            new mojo.internal.interfaceSupport.InterfaceRemoteBase(CommandHandlerFactoryPendingReceiver, handle);
        this.$ = new mojo.internal.interfaceSupport.InterfaceRemoteBaseWrapper(this.proxy);
        this.onConnectionError = this.proxy.getConnectionErrorEventRouter();
    }
    createBrowserCommandHandler(handler) {
        this.proxy.sendMessage(457050539, CommandHandlerFactory_CreateBrowserCommandHandler_ParamsSpec.$, null, [
            handler
        ], false);
    }
}
;
/**
 * An object which receives request messages for the CommandHandlerFactory
 * mojom interface. Must be constructed over an object which implements that
 * interface.
 */
export class CommandHandlerFactoryReceiver {
    helper_internal_;
    $;
    onConnectionError;
    constructor(impl) {
        this.helper_internal_ = new mojo.internal.interfaceSupport.InterfaceReceiverHelperInternal(CommandHandlerFactoryRemote);
        this.$ = new mojo.internal.interfaceSupport.InterfaceReceiverHelper(this.helper_internal_);
        this.helper_internal_.registerHandler(457050539, CommandHandlerFactory_CreateBrowserCommandHandler_ParamsSpec.$, null, impl.createBrowserCommandHandler.bind(impl), false);
        this.onConnectionError = this.helper_internal_.getConnectionErrorEventRouter();
    }
}
export class CommandHandlerFactory {
    static get $interfaceName() {
        return "browser_command.mojom.CommandHandlerFactory";
    }
    /**
     * Returns a remote for this interface which sends messages to the browser.
     * The browser must have an interface request binder registered for this
     * interface and accessible to the calling document's frame.
     */
    static getRemote() {
        let remote = new CommandHandlerFactoryRemote;
        remote.$.bindNewPipeAndPassReceiver().bindInBrowser();
        return remote;
    }
}
/**
 * An object which receives request messages for the CommandHandlerFactory
 * mojom interface and dispatches them as callbacks. One callback receiver exists
 * on this object for each message defined in the mojom interface, and each
 * receiver can have any number of listeners added to it.
 */
export class CommandHandlerFactoryCallbackRouter {
    helper_internal_;
    $;
    router_;
    createBrowserCommandHandler;
    onConnectionError;
    constructor() {
        this.helper_internal_ = new mojo.internal.interfaceSupport.InterfaceReceiverHelperInternal(CommandHandlerFactoryRemote);
        this.$ = new mojo.internal.interfaceSupport.InterfaceReceiverHelper(this.helper_internal_);
        this.router_ = new mojo.internal.interfaceSupport.CallbackRouter;
        this.createBrowserCommandHandler =
            new mojo.internal.interfaceSupport.InterfaceCallbackReceiver(this.router_);
        this.helper_internal_.registerHandler(457050539, CommandHandlerFactory_CreateBrowserCommandHandler_ParamsSpec.$, null, this.createBrowserCommandHandler.createReceiverHandler(false /* expectsResponse */), false);
        this.onConnectionError = this.helper_internal_.getConnectionErrorEventRouter();
    }
    /**
     * @param id An ID returned by a prior call to addListener.
     * @return True iff the identified listener was found and removed.
     */
    removeListener(id) {
        return this.router_.removeListener(id);
    }
}
export class CommandHandlerPendingReceiver {
    handle;
    constructor(handle) {
        this.handle = mojo.internal.interfaceSupport.getEndpointForReceiver(handle);
    }
    bindInBrowser(scope = 'context') {
        mojo.internal.interfaceSupport.bind(this.handle, 'browser_command.mojom.CommandHandler', scope);
    }
}
export class CommandHandlerRemote {
    proxy;
    $;
    onConnectionError;
    constructor(handle) {
        this.proxy =
            new mojo.internal.interfaceSupport.InterfaceRemoteBase(CommandHandlerPendingReceiver, handle);
        this.$ = new mojo.internal.interfaceSupport.InterfaceRemoteBaseWrapper(this.proxy);
        this.onConnectionError = this.proxy.getConnectionErrorEventRouter();
    }
    canExecuteCommand(commandId) {
        return this.proxy.sendMessage(1079142358, CommandHandler_CanExecuteCommand_ParamsSpec.$, CommandHandler_CanExecuteCommand_ResponseParamsSpec.$, [
            commandId
        ], false);
    }
    executeCommand(commandId, clickInfo) {
        return this.proxy.sendMessage(649982113, CommandHandler_ExecuteCommand_ParamsSpec.$, CommandHandler_ExecuteCommand_ResponseParamsSpec.$, [
            commandId,
            clickInfo
        ], false);
    }
}
;
/**
 * An object which receives request messages for the CommandHandler
 * mojom interface. Must be constructed over an object which implements that
 * interface.
 */
export class CommandHandlerReceiver {
    helper_internal_;
    $;
    onConnectionError;
    constructor(impl) {
        this.helper_internal_ = new mojo.internal.interfaceSupport.InterfaceReceiverHelperInternal(CommandHandlerRemote);
        this.$ = new mojo.internal.interfaceSupport.InterfaceReceiverHelper(this.helper_internal_);
        this.helper_internal_.registerHandler(1079142358, CommandHandler_CanExecuteCommand_ParamsSpec.$, CommandHandler_CanExecuteCommand_ResponseParamsSpec.$, impl.canExecuteCommand.bind(impl), false);
        this.helper_internal_.registerHandler(649982113, CommandHandler_ExecuteCommand_ParamsSpec.$, CommandHandler_ExecuteCommand_ResponseParamsSpec.$, impl.executeCommand.bind(impl), false);
        this.onConnectionError = this.helper_internal_.getConnectionErrorEventRouter();
    }
}
export class CommandHandler {
    static get $interfaceName() {
        return "browser_command.mojom.CommandHandler";
    }
    /**
     * Returns a remote for this interface which sends messages to the browser.
     * The browser must have an interface request binder registered for this
     * interface and accessible to the calling document's frame.
     */
    static getRemote() {
        let remote = new CommandHandlerRemote;
        remote.$.bindNewPipeAndPassReceiver().bindInBrowser();
        return remote;
    }
}
/**
 * An object which receives request messages for the CommandHandler
 * mojom interface and dispatches them as callbacks. One callback receiver exists
 * on this object for each message defined in the mojom interface, and each
 * receiver can have any number of listeners added to it.
 */
export class CommandHandlerCallbackRouter {
    helper_internal_;
    $;
    router_;
    canExecuteCommand;
    executeCommand;
    onConnectionError;
    constructor() {
        this.helper_internal_ = new mojo.internal.interfaceSupport.InterfaceReceiverHelperInternal(CommandHandlerRemote);
        this.$ = new mojo.internal.interfaceSupport.InterfaceReceiverHelper(this.helper_internal_);
        this.router_ = new mojo.internal.interfaceSupport.CallbackRouter;
        this.canExecuteCommand =
            new mojo.internal.interfaceSupport.InterfaceCallbackReceiver(this.router_);
        this.helper_internal_.registerHandler(1079142358, CommandHandler_CanExecuteCommand_ParamsSpec.$, CommandHandler_CanExecuteCommand_ResponseParamsSpec.$, this.canExecuteCommand.createReceiverHandler(true /* expectsResponse */), false);
        this.executeCommand =
            new mojo.internal.interfaceSupport.InterfaceCallbackReceiver(this.router_);
        this.helper_internal_.registerHandler(649982113, CommandHandler_ExecuteCommand_ParamsSpec.$, CommandHandler_ExecuteCommand_ResponseParamsSpec.$, this.executeCommand.createReceiverHandler(true /* expectsResponse */), false);
        this.onConnectionError = this.helper_internal_.getConnectionErrorEventRouter();
    }
    /**
     * @param id An ID returned by a prior call to addListener.
     * @return True iff the identified listener was found and removed.
     */
    removeListener(id) {
        return this.router_.removeListener(id);
    }
}
export const ClickInfoSpec = { $: {} };
export const CommandHandlerFactory_CreateBrowserCommandHandler_ParamsSpec = { $: {} };
export const CommandHandler_CanExecuteCommand_ParamsSpec = { $: {} };
export const CommandHandler_CanExecuteCommand_ResponseParamsSpec = { $: {} };
export const CommandHandler_ExecuteCommand_ParamsSpec = { $: {} };
export const CommandHandler_ExecuteCommand_ResponseParamsSpec = { $: {} };
mojo.internal.Struct(ClickInfoSpec.$, 'ClickInfo', [
    mojo.internal.StructField('middleButton', 0, 0, mojo.internal.Bool, false, false /* nullable */, 0, undefined, undefined),
    mojo.internal.StructField('altKey', 0, 1, mojo.internal.Bool, false, false /* nullable */, 0, undefined, undefined),
    mojo.internal.StructField('ctrlKey', 0, 2, mojo.internal.Bool, false, false /* nullable */, 0, undefined, undefined),
    mojo.internal.StructField('metaKey', 0, 3, mojo.internal.Bool, false, false /* nullable */, 0, undefined, undefined),
    mojo.internal.StructField('shiftKey', 0, 4, mojo.internal.Bool, false, false /* nullable */, 0, undefined, undefined),
], [[0, 16],]);
mojo.internal.Struct(CommandHandlerFactory_CreateBrowserCommandHandler_ParamsSpec.$, 'CommandHandlerFactory_CreateBrowserCommandHandler_Params', [
    mojo.internal.StructField('handler', 0, 0, mojo.internal.InterfaceRequest(CommandHandlerPendingReceiver), null, false /* nullable */, 0, undefined, undefined),
], [[0, 16],]);
mojo.internal.Struct(CommandHandler_CanExecuteCommand_ParamsSpec.$, 'CommandHandler_CanExecuteCommand_Params', [
    mojo.internal.StructField('commandId', 0, 0, CommandSpec.$, 0, false /* nullable */, 0, undefined, undefined),
], [[0, 16],]);
mojo.internal.Struct(CommandHandler_CanExecuteCommand_ResponseParamsSpec.$, 'CommandHandler_CanExecuteCommand_ResponseParams', [
    mojo.internal.StructField('canExecute', 0, 0, mojo.internal.Bool, false, false /* nullable */, 0, undefined, undefined),
], [[0, 16],]);
mojo.internal.Struct(CommandHandler_ExecuteCommand_ParamsSpec.$, 'CommandHandler_ExecuteCommand_Params', [
    mojo.internal.StructField('commandId', 0, 0, CommandSpec.$, 0, false /* nullable */, 0, undefined, undefined),
    mojo.internal.StructField('clickInfo', 8, 0, ClickInfoSpec.$, null, false /* nullable */, 0, undefined, undefined),
], [[0, 24],]);
mojo.internal.Struct(CommandHandler_ExecuteCommand_ResponseParamsSpec.$, 'CommandHandler_ExecuteCommand_ResponseParams', [
    mojo.internal.StructField('commandExecuted', 0, 0, mojo.internal.Bool, false, false /* nullable */, 0, undefined, undefined),
], [[0, 16],]);
