// chrome/browser/ui/webui/customize_buttons/customize_buttons.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';
import { MojoBrowserProxyFactory } from '//resources/mojo/mojo_browser_proxy.js';
import { CustomizeChromeSectionSpec as sidePanel_mojom_CustomizeChromeSectionSpec } from './customize_chrome.mojom-webui.js';
export const SidePanelOpenTriggerSpec = { $: mojo.internal.Enum() };
export var SidePanelOpenTrigger;
(function (SidePanelOpenTrigger) {
    SidePanelOpenTrigger[SidePanelOpenTrigger["MIN_VALUE"] = 0] = "MIN_VALUE";
    SidePanelOpenTrigger[SidePanelOpenTrigger["MAX_VALUE"] = 1] = "MAX_VALUE";
    SidePanelOpenTrigger[SidePanelOpenTrigger["kNewTabPage"] = 0] = "kNewTabPage";
    SidePanelOpenTrigger[SidePanelOpenTrigger["kNewTabFooter"] = 1] = "kNewTabFooter";
})(SidePanelOpenTrigger || (SidePanelOpenTrigger = {}));
export class CustomizeButtonsHandlerFactoryPendingReceiver {
    handle;
    constructor(handle) {
        this.handle = mojo.internal.interfaceSupport.getEndpointForReceiver(handle);
    }
    bindInBrowser(scope = 'context') {
        mojo.internal.interfaceSupport.bind(this.handle, 'customize_buttons.mojom.CustomizeButtonsHandlerFactory', scope);
    }
}
export class CustomizeButtonsHandlerFactoryRemote {
    proxy;
    $;
    onConnectionError;
    constructor(handle) {
        this.proxy =
            new mojo.internal.interfaceSupport.InterfaceRemoteBase(CustomizeButtonsHandlerFactoryPendingReceiver, handle);
        this.$ = new mojo.internal.interfaceSupport.InterfaceRemoteBaseWrapper(this.proxy);
        this.onConnectionError = this.proxy.getConnectionErrorEventRouter();
    }
    createCustomizeButtonsHandler(page, handler) {
        this.proxy.sendMessage(1169080917, CustomizeButtonsHandlerFactory_CreateCustomizeButtonsHandler_ParamsSpec.$, null, [
            page,
            handler
        ], false);
    }
}
;
/**
 * An object which receives request messages for the CustomizeButtonsHandlerFactory
 * mojom interface. Must be constructed over an object which implements that
 * interface.
 */
export class CustomizeButtonsHandlerFactoryReceiver {
    helper_internal_;
    $;
    onConnectionError;
    constructor(impl) {
        this.helper_internal_ = new mojo.internal.interfaceSupport.InterfaceReceiverHelperInternal(CustomizeButtonsHandlerFactoryRemote);
        this.$ = new mojo.internal.interfaceSupport.InterfaceReceiverHelper(this.helper_internal_);
        this.helper_internal_.registerHandler(1169080917, CustomizeButtonsHandlerFactory_CreateCustomizeButtonsHandler_ParamsSpec.$, null, impl.createCustomizeButtonsHandler.bind(impl), false);
        this.onConnectionError = this.helper_internal_.getConnectionErrorEventRouter();
    }
}
export class CustomizeButtonsHandlerFactory {
    static get $interfaceName() {
        return "customize_buttons.mojom.CustomizeButtonsHandlerFactory";
    }
    /**
     * 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 CustomizeButtonsHandlerFactoryRemote;
        remote.$.bindNewPipeAndPassReceiver().bindInBrowser();
        return remote;
    }
}
/**
 * An object which receives request messages for the CustomizeButtonsHandlerFactory
 * 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 CustomizeButtonsHandlerFactoryCallbackRouter {
    helper_internal_;
    $;
    router_;
    createCustomizeButtonsHandler;
    onConnectionError;
    constructor() {
        this.helper_internal_ = new mojo.internal.interfaceSupport.InterfaceReceiverHelperInternal(CustomizeButtonsHandlerFactoryRemote);
        this.$ = new mojo.internal.interfaceSupport.InterfaceReceiverHelper(this.helper_internal_);
        this.router_ = new mojo.internal.interfaceSupport.CallbackRouter;
        this.createCustomizeButtonsHandler =
            new mojo.internal.interfaceSupport.InterfaceCallbackReceiver(this.router_);
        this.helper_internal_.registerHandler(1169080917, CustomizeButtonsHandlerFactory_CreateCustomizeButtonsHandler_ParamsSpec.$, null, this.createCustomizeButtonsHandler.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 CustomizeButtonsHandlerPendingReceiver {
    handle;
    constructor(handle) {
        this.handle = mojo.internal.interfaceSupport.getEndpointForReceiver(handle);
    }
    bindInBrowser(scope = 'context') {
        mojo.internal.interfaceSupport.bind(this.handle, 'customize_buttons.mojom.CustomizeButtonsHandler', scope);
    }
}
export class CustomizeButtonsHandlerRemote {
    proxy;
    $;
    onConnectionError;
    constructor(handle) {
        this.proxy =
            new mojo.internal.interfaceSupport.InterfaceRemoteBase(CustomizeButtonsHandlerPendingReceiver, handle);
        this.$ = new mojo.internal.interfaceSupport.InterfaceRemoteBaseWrapper(this.proxy);
        this.onConnectionError = this.proxy.getConnectionErrorEventRouter();
    }
    incrementCustomizeChromeButtonOpenCount() {
        this.proxy.sendMessage(1636910708, CustomizeButtonsHandler_IncrementCustomizeChromeButtonOpenCount_ParamsSpec.$, null, [], false);
    }
    incrementWallpaperSearchButtonShownCount() {
        this.proxy.sendMessage(526360639, CustomizeButtonsHandler_IncrementWallpaperSearchButtonShownCount_ParamsSpec.$, null, [], false);
    }
    setCustomizeChromeSidePanelVisible(visible, section, trigger) {
        this.proxy.sendMessage(270777853, CustomizeButtonsHandler_SetCustomizeChromeSidePanelVisible_ParamsSpec.$, null, [
            visible,
            section,
            trigger
        ], false);
    }
}
;
/**
 * An object which receives request messages for the CustomizeButtonsHandler
 * mojom interface. Must be constructed over an object which implements that
 * interface.
 */
export class CustomizeButtonsHandlerReceiver {
    helper_internal_;
    $;
    onConnectionError;
    constructor(impl) {
        this.helper_internal_ = new mojo.internal.interfaceSupport.InterfaceReceiverHelperInternal(CustomizeButtonsHandlerRemote);
        this.$ = new mojo.internal.interfaceSupport.InterfaceReceiverHelper(this.helper_internal_);
        this.helper_internal_.registerHandler(1636910708, CustomizeButtonsHandler_IncrementCustomizeChromeButtonOpenCount_ParamsSpec.$, null, impl.incrementCustomizeChromeButtonOpenCount.bind(impl), false);
        this.helper_internal_.registerHandler(526360639, CustomizeButtonsHandler_IncrementWallpaperSearchButtonShownCount_ParamsSpec.$, null, impl.incrementWallpaperSearchButtonShownCount.bind(impl), false);
        this.helper_internal_.registerHandler(270777853, CustomizeButtonsHandler_SetCustomizeChromeSidePanelVisible_ParamsSpec.$, null, impl.setCustomizeChromeSidePanelVisible.bind(impl), false);
        this.onConnectionError = this.helper_internal_.getConnectionErrorEventRouter();
    }
}
export class CustomizeButtonsHandler {
    static get $interfaceName() {
        return "customize_buttons.mojom.CustomizeButtonsHandler";
    }
    /**
     * 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 CustomizeButtonsHandlerRemote;
        remote.$.bindNewPipeAndPassReceiver().bindInBrowser();
        return remote;
    }
}
/**
 * An object which receives request messages for the CustomizeButtonsHandler
 * 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 CustomizeButtonsHandlerCallbackRouter {
    helper_internal_;
    $;
    router_;
    incrementCustomizeChromeButtonOpenCount;
    incrementWallpaperSearchButtonShownCount;
    setCustomizeChromeSidePanelVisible;
    onConnectionError;
    constructor() {
        this.helper_internal_ = new mojo.internal.interfaceSupport.InterfaceReceiverHelperInternal(CustomizeButtonsHandlerRemote);
        this.$ = new mojo.internal.interfaceSupport.InterfaceReceiverHelper(this.helper_internal_);
        this.router_ = new mojo.internal.interfaceSupport.CallbackRouter;
        this.incrementCustomizeChromeButtonOpenCount =
            new mojo.internal.interfaceSupport.InterfaceCallbackReceiver(this.router_);
        this.helper_internal_.registerHandler(1636910708, CustomizeButtonsHandler_IncrementCustomizeChromeButtonOpenCount_ParamsSpec.$, null, this.incrementCustomizeChromeButtonOpenCount.createReceiverHandler(false /* expectsResponse */), false);
        this.incrementWallpaperSearchButtonShownCount =
            new mojo.internal.interfaceSupport.InterfaceCallbackReceiver(this.router_);
        this.helper_internal_.registerHandler(526360639, CustomizeButtonsHandler_IncrementWallpaperSearchButtonShownCount_ParamsSpec.$, null, this.incrementWallpaperSearchButtonShownCount.createReceiverHandler(false /* expectsResponse */), false);
        this.setCustomizeChromeSidePanelVisible =
            new mojo.internal.interfaceSupport.InterfaceCallbackReceiver(this.router_);
        this.helper_internal_.registerHandler(270777853, CustomizeButtonsHandler_SetCustomizeChromeSidePanelVisible_ParamsSpec.$, null, this.setCustomizeChromeSidePanelVisible.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 CustomizeButtonsDocumentPendingReceiver {
    handle;
    constructor(handle) {
        this.handle = mojo.internal.interfaceSupport.getEndpointForReceiver(handle);
    }
    bindInBrowser(scope = 'context') {
        mojo.internal.interfaceSupport.bind(this.handle, 'customize_buttons.mojom.CustomizeButtonsDocument', scope);
    }
}
export class CustomizeButtonsDocumentRemote {
    proxy;
    $;
    onConnectionError;
    constructor(handle) {
        this.proxy =
            new mojo.internal.interfaceSupport.InterfaceRemoteBase(CustomizeButtonsDocumentPendingReceiver, handle);
        this.$ = new mojo.internal.interfaceSupport.InterfaceRemoteBaseWrapper(this.proxy);
        this.onConnectionError = this.proxy.getConnectionErrorEventRouter();
    }
    setCustomizeChromeSidePanelVisibility(visible) {
        this.proxy.sendMessage(203633985, CustomizeButtonsDocument_SetCustomizeChromeSidePanelVisibility_ParamsSpec.$, null, [
            visible
        ], false);
    }
}
;
/**
 * An object which receives request messages for the CustomizeButtonsDocument
 * mojom interface. Must be constructed over an object which implements that
 * interface.
 */
export class CustomizeButtonsDocumentReceiver {
    helper_internal_;
    $;
    onConnectionError;
    constructor(impl) {
        this.helper_internal_ = new mojo.internal.interfaceSupport.InterfaceReceiverHelperInternal(CustomizeButtonsDocumentRemote);
        this.$ = new mojo.internal.interfaceSupport.InterfaceReceiverHelper(this.helper_internal_);
        this.helper_internal_.registerHandler(203633985, CustomizeButtonsDocument_SetCustomizeChromeSidePanelVisibility_ParamsSpec.$, null, impl.setCustomizeChromeSidePanelVisibility.bind(impl), false);
        this.onConnectionError = this.helper_internal_.getConnectionErrorEventRouter();
    }
}
export class CustomizeButtonsDocument {
    static get $interfaceName() {
        return "customize_buttons.mojom.CustomizeButtonsDocument";
    }
    /**
     * 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 CustomizeButtonsDocumentRemote;
        remote.$.bindNewPipeAndPassReceiver().bindInBrowser();
        return remote;
    }
}
/**
 * An object which receives request messages for the CustomizeButtonsDocument
 * 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 CustomizeButtonsDocumentCallbackRouter {
    helper_internal_;
    $;
    router_;
    setCustomizeChromeSidePanelVisibility;
    onConnectionError;
    constructor() {
        this.helper_internal_ = new mojo.internal.interfaceSupport.InterfaceReceiverHelperInternal(CustomizeButtonsDocumentRemote);
        this.$ = new mojo.internal.interfaceSupport.InterfaceReceiverHelper(this.helper_internal_);
        this.router_ = new mojo.internal.interfaceSupport.CallbackRouter;
        this.setCustomizeChromeSidePanelVisibility =
            new mojo.internal.interfaceSupport.InterfaceCallbackReceiver(this.router_);
        this.helper_internal_.registerHandler(203633985, CustomizeButtonsDocument_SetCustomizeChromeSidePanelVisibility_ParamsSpec.$, null, this.setCustomizeChromeSidePanelVisibility.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 const CustomizeButtonsHandlerFactory_CreateCustomizeButtonsHandler_ParamsSpec = { $: {} };
export const CustomizeButtonsHandler_IncrementCustomizeChromeButtonOpenCount_ParamsSpec = { $: {} };
export const CustomizeButtonsHandler_IncrementWallpaperSearchButtonShownCount_ParamsSpec = { $: {} };
export const CustomizeButtonsHandler_SetCustomizeChromeSidePanelVisible_ParamsSpec = { $: {} };
export const CustomizeButtonsDocument_SetCustomizeChromeSidePanelVisibility_ParamsSpec = { $: {} };
mojo.internal.Struct(CustomizeButtonsHandlerFactory_CreateCustomizeButtonsHandler_ParamsSpec.$, 'CustomizeButtonsHandlerFactory_CreateCustomizeButtonsHandler_Params', [
    mojo.internal.StructField('page', 0, 0, mojo.internal.InterfaceProxy(CustomizeButtonsDocumentRemote), null, false /* nullable */, 0, undefined, undefined),
    mojo.internal.StructField('handler', 8, 0, mojo.internal.InterfaceRequest(CustomizeButtonsHandlerPendingReceiver), null, false /* nullable */, 0, undefined, undefined),
], [[0, 24],]);
mojo.internal.Struct(CustomizeButtonsHandler_IncrementCustomizeChromeButtonOpenCount_ParamsSpec.$, 'CustomizeButtonsHandler_IncrementCustomizeChromeButtonOpenCount_Params', [], [[0, 8],]);
mojo.internal.Struct(CustomizeButtonsHandler_IncrementWallpaperSearchButtonShownCount_ParamsSpec.$, 'CustomizeButtonsHandler_IncrementWallpaperSearchButtonShownCount_Params', [], [[0, 8],]);
mojo.internal.Struct(CustomizeButtonsHandler_SetCustomizeChromeSidePanelVisible_ParamsSpec.$, 'CustomizeButtonsHandler_SetCustomizeChromeSidePanelVisible_Params', [
    mojo.internal.StructField('visible', 0, 0, mojo.internal.Bool, false, false /* nullable */, 0, undefined, undefined),
    mojo.internal.StructField('section', 4, 0, sidePanel_mojom_CustomizeChromeSectionSpec.$, 0, false /* nullable */, 0, undefined, undefined),
    mojo.internal.StructField('trigger', 8, 0, SidePanelOpenTriggerSpec.$, 0, false /* nullable */, 0, undefined, undefined),
], [[0, 24],]);
mojo.internal.Struct(CustomizeButtonsDocument_SetCustomizeChromeSidePanelVisibility_ParamsSpec.$, 'CustomizeButtonsDocument_SetCustomizeChromeSidePanelVisibility_Params', [
    mojo.internal.StructField('visible', 0, 0, mojo.internal.Bool, false, false /* nullable */, 0, undefined, undefined),
], [[0, 16],]);
export const browserProxyFactory = new MojoBrowserProxyFactory(CustomizeButtonsHandlerRemote, CustomizeButtonsDocumentCallbackRouter, (remote, receiver) => CustomizeButtonsHandlerFactory.getRemote().createCustomizeButtonsHandler(remote, receiver));
