// chrome/browser/ui/webui/personal_context/personal_context_notice.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 class PageHandlerPendingReceiver {
    handle;
    constructor(handle) {
        this.handle = mojo.internal.interfaceSupport.getEndpointForReceiver(handle);
    }
    bindInBrowser(scope = 'context') {
        mojo.internal.interfaceSupport.bind(this.handle, 'personal_context.notice.mojom.PageHandler', scope);
    }
}
export class PageHandlerRemote {
    proxy;
    $;
    onConnectionError;
    constructor(handle) {
        this.proxy =
            new mojo.internal.interfaceSupport.InterfaceRemoteBase(PageHandlerPendingReceiver, handle);
        this.$ = new mojo.internal.interfaceSupport.InterfaceRemoteBaseWrapper(this.proxy);
        this.onConnectionError = this.proxy.getConnectionErrorEventRouter();
    }
    getAccountInfo() {
        return this.proxy.sendMessage(1012903042, PageHandler_GetAccountInfo_ParamsSpec.$, PageHandler_GetAccountInfo_ResponseParamsSpec.$, [], false);
    }
    onNoticeAcknowledged() {
        this.proxy.sendMessage(398004220, PageHandler_OnNoticeAcknowledged_ParamsSpec.$, null, [], false);
    }
    onNoticeDismissed() {
        this.proxy.sendMessage(179876083, PageHandler_OnNoticeDismissed_ParamsSpec.$, null, [], false);
    }
    onManageSettingsClicked() {
        this.proxy.sendMessage(1470033631, PageHandler_OnManageSettingsClicked_ParamsSpec.$, null, [], false);
    }
    onLearnMoreClicked() {
        this.proxy.sendMessage(1282613696, PageHandler_OnLearnMoreClicked_ParamsSpec.$, null, [], false);
    }
    showUi() {
        this.proxy.sendMessage(588254614, PageHandler_ShowUi_ParamsSpec.$, null, [], false);
    }
}
;
/**
 * An object which receives request messages for the PageHandler
 * mojom interface. Must be constructed over an object which implements that
 * interface.
 */
export class PageHandlerReceiver {
    helper_internal_;
    $;
    onConnectionError;
    constructor(impl) {
        this.helper_internal_ = new mojo.internal.interfaceSupport.InterfaceReceiverHelperInternal(PageHandlerRemote);
        this.$ = new mojo.internal.interfaceSupport.InterfaceReceiverHelper(this.helper_internal_);
        this.helper_internal_.registerHandler(1012903042, PageHandler_GetAccountInfo_ParamsSpec.$, PageHandler_GetAccountInfo_ResponseParamsSpec.$, impl.getAccountInfo.bind(impl), false);
        this.helper_internal_.registerHandler(398004220, PageHandler_OnNoticeAcknowledged_ParamsSpec.$, null, impl.onNoticeAcknowledged.bind(impl), false);
        this.helper_internal_.registerHandler(179876083, PageHandler_OnNoticeDismissed_ParamsSpec.$, null, impl.onNoticeDismissed.bind(impl), false);
        this.helper_internal_.registerHandler(1470033631, PageHandler_OnManageSettingsClicked_ParamsSpec.$, null, impl.onManageSettingsClicked.bind(impl), false);
        this.helper_internal_.registerHandler(1282613696, PageHandler_OnLearnMoreClicked_ParamsSpec.$, null, impl.onLearnMoreClicked.bind(impl), false);
        this.helper_internal_.registerHandler(588254614, PageHandler_ShowUi_ParamsSpec.$, null, impl.showUi.bind(impl), false);
        this.onConnectionError = this.helper_internal_.getConnectionErrorEventRouter();
    }
}
export class PageHandler {
    static get $interfaceName() {
        return "personal_context.notice.mojom.PageHandler";
    }
    /**
     * 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 PageHandlerRemote;
        remote.$.bindNewPipeAndPassReceiver().bindInBrowser();
        return remote;
    }
}
/**
 * An object which receives request messages for the PageHandler
 * 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 PageHandlerCallbackRouter {
    helper_internal_;
    $;
    router_;
    getAccountInfo;
    onNoticeAcknowledged;
    onNoticeDismissed;
    onManageSettingsClicked;
    onLearnMoreClicked;
    showUi;
    onConnectionError;
    constructor() {
        this.helper_internal_ = new mojo.internal.interfaceSupport.InterfaceReceiverHelperInternal(PageHandlerRemote);
        this.$ = new mojo.internal.interfaceSupport.InterfaceReceiverHelper(this.helper_internal_);
        this.router_ = new mojo.internal.interfaceSupport.CallbackRouter;
        this.getAccountInfo =
            new mojo.internal.interfaceSupport.InterfaceCallbackReceiver(this.router_);
        this.helper_internal_.registerHandler(1012903042, PageHandler_GetAccountInfo_ParamsSpec.$, PageHandler_GetAccountInfo_ResponseParamsSpec.$, this.getAccountInfo.createReceiverHandler(true /* expectsResponse */), false);
        this.onNoticeAcknowledged =
            new mojo.internal.interfaceSupport.InterfaceCallbackReceiver(this.router_);
        this.helper_internal_.registerHandler(398004220, PageHandler_OnNoticeAcknowledged_ParamsSpec.$, null, this.onNoticeAcknowledged.createReceiverHandler(false /* expectsResponse */), false);
        this.onNoticeDismissed =
            new mojo.internal.interfaceSupport.InterfaceCallbackReceiver(this.router_);
        this.helper_internal_.registerHandler(179876083, PageHandler_OnNoticeDismissed_ParamsSpec.$, null, this.onNoticeDismissed.createReceiverHandler(false /* expectsResponse */), false);
        this.onManageSettingsClicked =
            new mojo.internal.interfaceSupport.InterfaceCallbackReceiver(this.router_);
        this.helper_internal_.registerHandler(1470033631, PageHandler_OnManageSettingsClicked_ParamsSpec.$, null, this.onManageSettingsClicked.createReceiverHandler(false /* expectsResponse */), false);
        this.onLearnMoreClicked =
            new mojo.internal.interfaceSupport.InterfaceCallbackReceiver(this.router_);
        this.helper_internal_.registerHandler(1282613696, PageHandler_OnLearnMoreClicked_ParamsSpec.$, null, this.onLearnMoreClicked.createReceiverHandler(false /* expectsResponse */), false);
        this.showUi =
            new mojo.internal.interfaceSupport.InterfaceCallbackReceiver(this.router_);
        this.helper_internal_.registerHandler(588254614, PageHandler_ShowUi_ParamsSpec.$, null, this.showUi.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 AccountInfoSpec = { $: {} };
export const PageHandler_GetAccountInfo_ParamsSpec = { $: {} };
export const PageHandler_GetAccountInfo_ResponseParamsSpec = { $: {} };
export const PageHandler_OnNoticeAcknowledged_ParamsSpec = { $: {} };
export const PageHandler_OnNoticeDismissed_ParamsSpec = { $: {} };
export const PageHandler_OnManageSettingsClicked_ParamsSpec = { $: {} };
export const PageHandler_OnLearnMoreClicked_ParamsSpec = { $: {} };
export const PageHandler_ShowUi_ParamsSpec = { $: {} };
mojo.internal.Struct(AccountInfoSpec.$, 'AccountInfo', [
    mojo.internal.StructField('email', 0, 0, mojo.internal.String, null, false /* nullable */, 0, undefined, undefined),
    mojo.internal.StructField('avatarUrl', 8, 0, mojo.internal.String, null, false /* nullable */, 0, undefined, undefined),
], [[0, 24],]);
mojo.internal.Struct(PageHandler_GetAccountInfo_ParamsSpec.$, 'PageHandler_GetAccountInfo_Params', [], [[0, 8],]);
mojo.internal.Struct(PageHandler_GetAccountInfo_ResponseParamsSpec.$, 'PageHandler_GetAccountInfo_ResponseParams', [
    mojo.internal.StructField('info', 0, 0, AccountInfoSpec.$, null, true /* nullable */, 0, undefined, undefined),
], [[0, 16],]);
mojo.internal.Struct(PageHandler_OnNoticeAcknowledged_ParamsSpec.$, 'PageHandler_OnNoticeAcknowledged_Params', [], [[0, 8],]);
mojo.internal.Struct(PageHandler_OnNoticeDismissed_ParamsSpec.$, 'PageHandler_OnNoticeDismissed_Params', [], [[0, 8],]);
mojo.internal.Struct(PageHandler_OnManageSettingsClicked_ParamsSpec.$, 'PageHandler_OnManageSettingsClicked_Params', [], [[0, 8],]);
mojo.internal.Struct(PageHandler_OnLearnMoreClicked_ParamsSpec.$, 'PageHandler_OnLearnMoreClicked_Params', [], [[0, 8],]);
mojo.internal.Struct(PageHandler_ShowUi_ParamsSpec.$, 'PageHandler_ShowUi_Params', [], [[0, 8],]);
