// chrome/browser/ui/webui_browser/browser.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 { NodeIdSpec as tabsApi_mojom_NodeIdSpec } from './tab_strip_api_types.mojom-webui.js';
import { UnguessableTokenSpec as mojoBase_mojom_UnguessableTokenSpec } from '//resources/mojo/mojo/public/mojom/base/unguessable_token.mojom-webui.js';
import { UrlSpec as url_mojom_UrlSpec } from '//resources/mojo/url/mojom/url.mojom-webui.js';
export const FullscreenContextSpec = { $: mojo.internal.Enum() };
export var FullscreenContext;
(function (FullscreenContext) {
    FullscreenContext[FullscreenContext["MIN_VALUE"] = 0] = "MIN_VALUE";
    FullscreenContext[FullscreenContext["MAX_VALUE"] = 1] = "MAX_VALUE";
    FullscreenContext[FullscreenContext["kBrowser"] = 0] = "kBrowser";
    FullscreenContext[FullscreenContext["kTab"] = 1] = "kTab";
})(FullscreenContext || (FullscreenContext = {}));
export const SecurityIconSpec = { $: mojo.internal.Enum() };
export var SecurityIcon;
(function (SecurityIcon) {
    SecurityIcon[SecurityIcon["MIN_VALUE"] = 0] = "MIN_VALUE";
    SecurityIcon[SecurityIcon["MAX_VALUE"] = 8] = "MAX_VALUE";
    SecurityIcon[SecurityIcon["HttpChromeRefresh"] = 0] = "HttpChromeRefresh";
    SecurityIcon[SecurityIcon["SecurePageInfoChromeRefresh"] = 1] = "SecurePageInfoChromeRefresh";
    SecurityIcon[SecurityIcon["NoEncryption"] = 2] = "NoEncryption";
    SecurityIcon[SecurityIcon["NotSecureWarningChromeRefresh"] = 3] = "NotSecureWarningChromeRefresh";
    SecurityIcon[SecurityIcon["BusinessChromeRefresh"] = 4] = "BusinessChromeRefresh";
    SecurityIcon[SecurityIcon["DangerousChromeRefresh"] = 5] = "DangerousChromeRefresh";
    SecurityIcon[SecurityIcon["ProductChromeRefresh"] = 6] = "ProductChromeRefresh";
    SecurityIcon[SecurityIcon["ExtensionChromeRefresh"] = 7] = "ExtensionChromeRefresh";
    SecurityIcon[SecurityIcon["OfflinePin"] = 8] = "OfflinePin";
})(SecurityIcon || (SecurityIcon = {}));
export class PageHandlerFactoryPendingReceiver {
    handle;
    constructor(handle) {
        this.handle = mojo.internal.interfaceSupport.getEndpointForReceiver(handle);
    }
    bindInBrowser(scope = 'context') {
        mojo.internal.interfaceSupport.bind(this.handle, 'webui_browser.mojom.PageHandlerFactory', scope);
    }
}
export class PageHandlerFactoryRemote {
    proxy;
    $;
    onConnectionError;
    constructor(handle) {
        this.proxy =
            new mojo.internal.interfaceSupport.InterfaceRemoteBase(PageHandlerFactoryPendingReceiver, handle);
        this.$ = new mojo.internal.interfaceSupport.InterfaceRemoteBaseWrapper(this.proxy);
        this.onConnectionError = this.proxy.getConnectionErrorEventRouter();
    }
    createPageHandler(page, handler) {
        this.proxy.sendMessage(108481000, PageHandlerFactory_CreatePageHandler_ParamsSpec.$, null, [
            page,
            handler
        ], false);
    }
}
;
/**
 * An object which receives request messages for the PageHandlerFactory
 * mojom interface. Must be constructed over an object which implements that
 * interface.
 */
export class PageHandlerFactoryReceiver {
    helper_internal_;
    $;
    onConnectionError;
    constructor(impl) {
        this.helper_internal_ = new mojo.internal.interfaceSupport.InterfaceReceiverHelperInternal(PageHandlerFactoryRemote);
        this.$ = new mojo.internal.interfaceSupport.InterfaceReceiverHelper(this.helper_internal_);
        this.helper_internal_.registerHandler(108481000, PageHandlerFactory_CreatePageHandler_ParamsSpec.$, null, impl.createPageHandler.bind(impl), false);
        this.onConnectionError = this.helper_internal_.getConnectionErrorEventRouter();
    }
}
export class PageHandlerFactory {
    static get $interfaceName() {
        return "webui_browser.mojom.PageHandlerFactory";
    }
    /**
     * 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 PageHandlerFactoryRemote;
        remote.$.bindNewPipeAndPassReceiver().bindInBrowser();
        return remote;
    }
}
/**
 * An object which receives request messages for the PageHandlerFactory
 * 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 PageHandlerFactoryCallbackRouter {
    helper_internal_;
    $;
    router_;
    createPageHandler;
    onConnectionError;
    constructor() {
        this.helper_internal_ = new mojo.internal.interfaceSupport.InterfaceReceiverHelperInternal(PageHandlerFactoryRemote);
        this.$ = new mojo.internal.interfaceSupport.InterfaceReceiverHelper(this.helper_internal_);
        this.router_ = new mojo.internal.interfaceSupport.CallbackRouter;
        this.createPageHandler =
            new mojo.internal.interfaceSupport.InterfaceCallbackReceiver(this.router_);
        this.helper_internal_.registerHandler(108481000, PageHandlerFactory_CreatePageHandler_ParamsSpec.$, null, this.createPageHandler.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 PagePendingReceiver {
    handle;
    constructor(handle) {
        this.handle = mojo.internal.interfaceSupport.getEndpointForReceiver(handle);
    }
    bindInBrowser(scope = 'context') {
        mojo.internal.interfaceSupport.bind(this.handle, 'webui_browser.mojom.Page', scope);
    }
}
export class PageRemote {
    proxy;
    $;
    onConnectionError;
    constructor(handle) {
        this.proxy =
            new mojo.internal.interfaceSupport.InterfaceRemoteBase(PagePendingReceiver, handle);
        this.$ = new mojo.internal.interfaceSupport.InterfaceRemoteBaseWrapper(this.proxy);
        this.onConnectionError = this.proxy.getConnectionErrorEventRouter();
    }
    setFocusToLocationBar(isUserInitiated) {
        this.proxy.sendMessage(509658237, Page_SetFocusToLocationBar_ParamsSpec.$, null, [
            isUserInitiated
        ], false);
    }
    setReloadStopState(isLoading) {
        this.proxy.sendMessage(1599974764, Page_SetReloadStopState_ParamsSpec.$, null, [
            isLoading
        ], false);
    }
    showSidePanel(guestContentsId, title) {
        this.proxy.sendMessage(618650310, Page_ShowSidePanel_ParamsSpec.$, null, [
            guestContentsId,
            title
        ], false);
    }
    closeSidePanel() {
        this.proxy.sendMessage(1786964548, Page_CloseSidePanel_ParamsSpec.$, null, [], false);
    }
    onFullscreenModeChanged(isFullscreen, context) {
        this.proxy.sendMessage(633938165, Page_OnFullscreenModeChanged_ParamsSpec.$, null, [
            isFullscreen,
            context
        ], false);
    }
    onPaintAsActiveChanged(active) {
        this.proxy.sendMessage(1538996518, Page_OnPaintAsActiveChanged_ParamsSpec.$, null, [
            active
        ], false);
    }
}
;
/**
 * An object which receives request messages for the Page
 * mojom interface. Must be constructed over an object which implements that
 * interface.
 */
export class PageReceiver {
    helper_internal_;
    $;
    onConnectionError;
    constructor(impl) {
        this.helper_internal_ = new mojo.internal.interfaceSupport.InterfaceReceiverHelperInternal(PageRemote);
        this.$ = new mojo.internal.interfaceSupport.InterfaceReceiverHelper(this.helper_internal_);
        this.helper_internal_.registerHandler(509658237, Page_SetFocusToLocationBar_ParamsSpec.$, null, impl.setFocusToLocationBar.bind(impl), false);
        this.helper_internal_.registerHandler(1599974764, Page_SetReloadStopState_ParamsSpec.$, null, impl.setReloadStopState.bind(impl), false);
        this.helper_internal_.registerHandler(618650310, Page_ShowSidePanel_ParamsSpec.$, null, impl.showSidePanel.bind(impl), false);
        this.helper_internal_.registerHandler(1786964548, Page_CloseSidePanel_ParamsSpec.$, null, impl.closeSidePanel.bind(impl), false);
        this.helper_internal_.registerHandler(633938165, Page_OnFullscreenModeChanged_ParamsSpec.$, null, impl.onFullscreenModeChanged.bind(impl), false);
        this.helper_internal_.registerHandler(1538996518, Page_OnPaintAsActiveChanged_ParamsSpec.$, null, impl.onPaintAsActiveChanged.bind(impl), false);
        this.onConnectionError = this.helper_internal_.getConnectionErrorEventRouter();
    }
}
export class Page {
    static get $interfaceName() {
        return "webui_browser.mojom.Page";
    }
    /**
     * 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 PageRemote;
        remote.$.bindNewPipeAndPassReceiver().bindInBrowser();
        return remote;
    }
}
/**
 * An object which receives request messages for the Page
 * 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 PageCallbackRouter {
    helper_internal_;
    $;
    router_;
    setFocusToLocationBar;
    setReloadStopState;
    showSidePanel;
    closeSidePanel;
    onFullscreenModeChanged;
    onPaintAsActiveChanged;
    onConnectionError;
    constructor() {
        this.helper_internal_ = new mojo.internal.interfaceSupport.InterfaceReceiverHelperInternal(PageRemote);
        this.$ = new mojo.internal.interfaceSupport.InterfaceReceiverHelper(this.helper_internal_);
        this.router_ = new mojo.internal.interfaceSupport.CallbackRouter;
        this.setFocusToLocationBar =
            new mojo.internal.interfaceSupport.InterfaceCallbackReceiver(this.router_);
        this.helper_internal_.registerHandler(509658237, Page_SetFocusToLocationBar_ParamsSpec.$, null, this.setFocusToLocationBar.createReceiverHandler(false /* expectsResponse */), false);
        this.setReloadStopState =
            new mojo.internal.interfaceSupport.InterfaceCallbackReceiver(this.router_);
        this.helper_internal_.registerHandler(1599974764, Page_SetReloadStopState_ParamsSpec.$, null, this.setReloadStopState.createReceiverHandler(false /* expectsResponse */), false);
        this.showSidePanel =
            new mojo.internal.interfaceSupport.InterfaceCallbackReceiver(this.router_);
        this.helper_internal_.registerHandler(618650310, Page_ShowSidePanel_ParamsSpec.$, null, this.showSidePanel.createReceiverHandler(false /* expectsResponse */), false);
        this.closeSidePanel =
            new mojo.internal.interfaceSupport.InterfaceCallbackReceiver(this.router_);
        this.helper_internal_.registerHandler(1786964548, Page_CloseSidePanel_ParamsSpec.$, null, this.closeSidePanel.createReceiverHandler(false /* expectsResponse */), false);
        this.onFullscreenModeChanged =
            new mojo.internal.interfaceSupport.InterfaceCallbackReceiver(this.router_);
        this.helper_internal_.registerHandler(633938165, Page_OnFullscreenModeChanged_ParamsSpec.$, null, this.onFullscreenModeChanged.createReceiverHandler(false /* expectsResponse */), false);
        this.onPaintAsActiveChanged =
            new mojo.internal.interfaceSupport.InterfaceCallbackReceiver(this.router_);
        this.helper_internal_.registerHandler(1538996518, Page_OnPaintAsActiveChanged_ParamsSpec.$, null, this.onPaintAsActiveChanged.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 PageHandlerPendingReceiver {
    handle;
    constructor(handle) {
        this.handle = mojo.internal.interfaceSupport.getEndpointForReceiver(handle);
    }
    bindInBrowser(scope = 'context') {
        mojo.internal.interfaceSupport.bind(this.handle, 'webui_browser.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();
    }
    getGuestIdForTabId(tabId, handler) {
        return this.proxy.sendMessage(1021481800, PageHandler_GetGuestIdForTabId_ParamsSpec.$, PageHandler_GetGuestIdForTabId_ResponseParamsSpec.$, [
            tabId,
            handler
        ], false);
    }
    loadTabSearch() {
        return this.proxy.sendMessage(2066630691, PageHandler_LoadTabSearch_ParamsSpec.$, PageHandler_LoadTabSearch_ResponseParamsSpec.$, [], false);
    }
    showTabSearchBubble(anchorName) {
        this.proxy.sendMessage(358279562, PageHandler_ShowTabSearchBubble_ParamsSpec.$, null, [
            anchorName
        ], false);
    }
    openAppMenu() {
        this.proxy.sendMessage(833579114, PageHandler_OpenAppMenu_ParamsSpec.$, null, [], false);
    }
    openProfileMenu() {
        this.proxy.sendMessage(1441031772, PageHandler_OpenProfileMenu_ParamsSpec.$, null, [], false);
    }
    launchDevToolsForBrowser() {
        this.proxy.sendMessage(96813383, PageHandler_LaunchDevToolsForBrowser_ParamsSpec.$, null, [], false);
    }
    onSidePanelClosed() {
        this.proxy.sendMessage(1520207430, PageHandler_OnSidePanelClosed_ParamsSpec.$, null, [], false);
    }
    minimize() {
        this.proxy.sendMessage(457779360, PageHandler_Minimize_ParamsSpec.$, null, [], false);
    }
    maximize() {
        this.proxy.sendMessage(711483490, PageHandler_Maximize_ParamsSpec.$, null, [], false);
    }
    restore() {
        this.proxy.sendMessage(423628025, PageHandler_Restore_ParamsSpec.$, null, [], false);
    }
    close() {
        this.proxy.sendMessage(1772645340, PageHandler_Close_ParamsSpec.$, null, [], false);
    }
    showBackForwardMenu(isBack) {
        this.proxy.sendMessage(899528004, PageHandler_ShowBackForwardMenu_ParamsSpec.$, null, [
            isBack
        ], false);
    }
    getTabStripInset() {
        return this.proxy.sendMessage(686479421, PageHandler_GetTabStripInset_ParamsSpec.$, PageHandler_GetTabStripInset_ResponseParamsSpec.$, [], 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(1021481800, PageHandler_GetGuestIdForTabId_ParamsSpec.$, PageHandler_GetGuestIdForTabId_ResponseParamsSpec.$, impl.getGuestIdForTabId.bind(impl), false);
        this.helper_internal_.registerHandler(2066630691, PageHandler_LoadTabSearch_ParamsSpec.$, PageHandler_LoadTabSearch_ResponseParamsSpec.$, impl.loadTabSearch.bind(impl), false);
        this.helper_internal_.registerHandler(358279562, PageHandler_ShowTabSearchBubble_ParamsSpec.$, null, impl.showTabSearchBubble.bind(impl), false);
        this.helper_internal_.registerHandler(833579114, PageHandler_OpenAppMenu_ParamsSpec.$, null, impl.openAppMenu.bind(impl), false);
        this.helper_internal_.registerHandler(1441031772, PageHandler_OpenProfileMenu_ParamsSpec.$, null, impl.openProfileMenu.bind(impl), false);
        this.helper_internal_.registerHandler(96813383, PageHandler_LaunchDevToolsForBrowser_ParamsSpec.$, null, impl.launchDevToolsForBrowser.bind(impl), false);
        this.helper_internal_.registerHandler(1520207430, PageHandler_OnSidePanelClosed_ParamsSpec.$, null, impl.onSidePanelClosed.bind(impl), false);
        this.helper_internal_.registerHandler(457779360, PageHandler_Minimize_ParamsSpec.$, null, impl.minimize.bind(impl), false);
        this.helper_internal_.registerHandler(711483490, PageHandler_Maximize_ParamsSpec.$, null, impl.maximize.bind(impl), false);
        this.helper_internal_.registerHandler(423628025, PageHandler_Restore_ParamsSpec.$, null, impl.restore.bind(impl), false);
        this.helper_internal_.registerHandler(1772645340, PageHandler_Close_ParamsSpec.$, null, impl.close.bind(impl), false);
        this.helper_internal_.registerHandler(899528004, PageHandler_ShowBackForwardMenu_ParamsSpec.$, null, impl.showBackForwardMenu.bind(impl), false);
        this.helper_internal_.registerHandler(686479421, PageHandler_GetTabStripInset_ParamsSpec.$, PageHandler_GetTabStripInset_ResponseParamsSpec.$, impl.getTabStripInset.bind(impl), false);
        this.onConnectionError = this.helper_internal_.getConnectionErrorEventRouter();
    }
}
export class PageHandler {
    static get $interfaceName() {
        return "webui_browser.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_;
    getGuestIdForTabId;
    loadTabSearch;
    showTabSearchBubble;
    openAppMenu;
    openProfileMenu;
    launchDevToolsForBrowser;
    onSidePanelClosed;
    minimize;
    maximize;
    restore;
    close;
    showBackForwardMenu;
    getTabStripInset;
    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.getGuestIdForTabId =
            new mojo.internal.interfaceSupport.InterfaceCallbackReceiver(this.router_);
        this.helper_internal_.registerHandler(1021481800, PageHandler_GetGuestIdForTabId_ParamsSpec.$, PageHandler_GetGuestIdForTabId_ResponseParamsSpec.$, this.getGuestIdForTabId.createReceiverHandler(true /* expectsResponse */), false);
        this.loadTabSearch =
            new mojo.internal.interfaceSupport.InterfaceCallbackReceiver(this.router_);
        this.helper_internal_.registerHandler(2066630691, PageHandler_LoadTabSearch_ParamsSpec.$, PageHandler_LoadTabSearch_ResponseParamsSpec.$, this.loadTabSearch.createReceiverHandler(true /* expectsResponse */), false);
        this.showTabSearchBubble =
            new mojo.internal.interfaceSupport.InterfaceCallbackReceiver(this.router_);
        this.helper_internal_.registerHandler(358279562, PageHandler_ShowTabSearchBubble_ParamsSpec.$, null, this.showTabSearchBubble.createReceiverHandler(false /* expectsResponse */), false);
        this.openAppMenu =
            new mojo.internal.interfaceSupport.InterfaceCallbackReceiver(this.router_);
        this.helper_internal_.registerHandler(833579114, PageHandler_OpenAppMenu_ParamsSpec.$, null, this.openAppMenu.createReceiverHandler(false /* expectsResponse */), false);
        this.openProfileMenu =
            new mojo.internal.interfaceSupport.InterfaceCallbackReceiver(this.router_);
        this.helper_internal_.registerHandler(1441031772, PageHandler_OpenProfileMenu_ParamsSpec.$, null, this.openProfileMenu.createReceiverHandler(false /* expectsResponse */), false);
        this.launchDevToolsForBrowser =
            new mojo.internal.interfaceSupport.InterfaceCallbackReceiver(this.router_);
        this.helper_internal_.registerHandler(96813383, PageHandler_LaunchDevToolsForBrowser_ParamsSpec.$, null, this.launchDevToolsForBrowser.createReceiverHandler(false /* expectsResponse */), false);
        this.onSidePanelClosed =
            new mojo.internal.interfaceSupport.InterfaceCallbackReceiver(this.router_);
        this.helper_internal_.registerHandler(1520207430, PageHandler_OnSidePanelClosed_ParamsSpec.$, null, this.onSidePanelClosed.createReceiverHandler(false /* expectsResponse */), false);
        this.minimize =
            new mojo.internal.interfaceSupport.InterfaceCallbackReceiver(this.router_);
        this.helper_internal_.registerHandler(457779360, PageHandler_Minimize_ParamsSpec.$, null, this.minimize.createReceiverHandler(false /* expectsResponse */), false);
        this.maximize =
            new mojo.internal.interfaceSupport.InterfaceCallbackReceiver(this.router_);
        this.helper_internal_.registerHandler(711483490, PageHandler_Maximize_ParamsSpec.$, null, this.maximize.createReceiverHandler(false /* expectsResponse */), false);
        this.restore =
            new mojo.internal.interfaceSupport.InterfaceCallbackReceiver(this.router_);
        this.helper_internal_.registerHandler(423628025, PageHandler_Restore_ParamsSpec.$, null, this.restore.createReceiverHandler(false /* expectsResponse */), false);
        this.close =
            new mojo.internal.interfaceSupport.InterfaceCallbackReceiver(this.router_);
        this.helper_internal_.registerHandler(1772645340, PageHandler_Close_ParamsSpec.$, null, this.close.createReceiverHandler(false /* expectsResponse */), false);
        this.showBackForwardMenu =
            new mojo.internal.interfaceSupport.InterfaceCallbackReceiver(this.router_);
        this.helper_internal_.registerHandler(899528004, PageHandler_ShowBackForwardMenu_ParamsSpec.$, null, this.showBackForwardMenu.createReceiverHandler(false /* expectsResponse */), false);
        this.getTabStripInset =
            new mojo.internal.interfaceSupport.InterfaceCallbackReceiver(this.router_);
        this.helper_internal_.registerHandler(686479421, PageHandler_GetTabStripInset_ParamsSpec.$, PageHandler_GetTabStripInset_ResponseParamsSpec.$, this.getTabStripInset.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 class GuestHandlerPendingReceiver {
    handle;
    constructor(handle) {
        this.handle = mojo.internal.interfaceSupport.getEndpointForReceiver(handle);
    }
    bindInBrowser(scope = 'context') {
        mojo.internal.interfaceSupport.bind(this.handle, 'webui_browser.mojom.GuestHandler', scope);
    }
}
export class GuestHandlerRemote {
    proxy;
    $;
    onConnectionError;
    constructor(handle) {
        this.proxy =
            new mojo.internal.interfaceSupport.InterfaceRemoteBase(GuestHandlerPendingReceiver, handle);
        this.$ = new mojo.internal.interfaceSupport.InterfaceRemoteBaseWrapper(this.proxy);
        this.onConnectionError = this.proxy.getConnectionErrorEventRouter();
    }
    navigate(src) {
        this.proxy.sendMessage(1459223446, GuestHandler_Navigate_ParamsSpec.$, null, [
            src
        ], false);
    }
    canGoBack() {
        return this.proxy.sendMessage(651045390, GuestHandler_CanGoBack_ParamsSpec.$, GuestHandler_CanGoBack_ResponseParamsSpec.$, [], false);
    }
    goBack() {
        this.proxy.sendMessage(176329721, GuestHandler_GoBack_ParamsSpec.$, null, [], false);
    }
    canGoForward() {
        return this.proxy.sendMessage(887357769, GuestHandler_CanGoForward_ParamsSpec.$, GuestHandler_CanGoForward_ResponseParamsSpec.$, [], false);
    }
    goForward() {
        this.proxy.sendMessage(668625532, GuestHandler_GoForward_ParamsSpec.$, null, [], false);
    }
    reload() {
        this.proxy.sendMessage(1816165492, GuestHandler_Reload_ParamsSpec.$, null, [], false);
    }
    stopLoading() {
        this.proxy.sendMessage(629685343, GuestHandler_StopLoading_ParamsSpec.$, null, [], false);
    }
    openPageInfoMenu() {
        this.proxy.sendMessage(1690373268, GuestHandler_OpenPageInfoMenu_ParamsSpec.$, null, [], false);
    }
    getSecurityIcon() {
        return this.proxy.sendMessage(1589616709, GuestHandler_GetSecurityIcon_ParamsSpec.$, GuestHandler_GetSecurityIcon_ResponseParamsSpec.$, [], false);
    }
}
;
/**
 * An object which receives request messages for the GuestHandler
 * mojom interface. Must be constructed over an object which implements that
 * interface.
 */
export class GuestHandlerReceiver {
    helper_internal_;
    $;
    onConnectionError;
    constructor(impl) {
        this.helper_internal_ = new mojo.internal.interfaceSupport.InterfaceReceiverHelperInternal(GuestHandlerRemote);
        this.$ = new mojo.internal.interfaceSupport.InterfaceReceiverHelper(this.helper_internal_);
        this.helper_internal_.registerHandler(1459223446, GuestHandler_Navigate_ParamsSpec.$, null, impl.navigate.bind(impl), false);
        this.helper_internal_.registerHandler(651045390, GuestHandler_CanGoBack_ParamsSpec.$, GuestHandler_CanGoBack_ResponseParamsSpec.$, impl.canGoBack.bind(impl), false);
        this.helper_internal_.registerHandler(176329721, GuestHandler_GoBack_ParamsSpec.$, null, impl.goBack.bind(impl), false);
        this.helper_internal_.registerHandler(887357769, GuestHandler_CanGoForward_ParamsSpec.$, GuestHandler_CanGoForward_ResponseParamsSpec.$, impl.canGoForward.bind(impl), false);
        this.helper_internal_.registerHandler(668625532, GuestHandler_GoForward_ParamsSpec.$, null, impl.goForward.bind(impl), false);
        this.helper_internal_.registerHandler(1816165492, GuestHandler_Reload_ParamsSpec.$, null, impl.reload.bind(impl), false);
        this.helper_internal_.registerHandler(629685343, GuestHandler_StopLoading_ParamsSpec.$, null, impl.stopLoading.bind(impl), false);
        this.helper_internal_.registerHandler(1690373268, GuestHandler_OpenPageInfoMenu_ParamsSpec.$, null, impl.openPageInfoMenu.bind(impl), false);
        this.helper_internal_.registerHandler(1589616709, GuestHandler_GetSecurityIcon_ParamsSpec.$, GuestHandler_GetSecurityIcon_ResponseParamsSpec.$, impl.getSecurityIcon.bind(impl), false);
        this.onConnectionError = this.helper_internal_.getConnectionErrorEventRouter();
    }
}
export class GuestHandler {
    static get $interfaceName() {
        return "webui_browser.mojom.GuestHandler";
    }
    /**
     * 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 GuestHandlerRemote;
        remote.$.bindNewPipeAndPassReceiver().bindInBrowser();
        return remote;
    }
}
/**
 * An object which receives request messages for the GuestHandler
 * 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 GuestHandlerCallbackRouter {
    helper_internal_;
    $;
    router_;
    navigate;
    canGoBack;
    goBack;
    canGoForward;
    goForward;
    reload;
    stopLoading;
    openPageInfoMenu;
    getSecurityIcon;
    onConnectionError;
    constructor() {
        this.helper_internal_ = new mojo.internal.interfaceSupport.InterfaceReceiverHelperInternal(GuestHandlerRemote);
        this.$ = new mojo.internal.interfaceSupport.InterfaceReceiverHelper(this.helper_internal_);
        this.router_ = new mojo.internal.interfaceSupport.CallbackRouter;
        this.navigate =
            new mojo.internal.interfaceSupport.InterfaceCallbackReceiver(this.router_);
        this.helper_internal_.registerHandler(1459223446, GuestHandler_Navigate_ParamsSpec.$, null, this.navigate.createReceiverHandler(false /* expectsResponse */), false);
        this.canGoBack =
            new mojo.internal.interfaceSupport.InterfaceCallbackReceiver(this.router_);
        this.helper_internal_.registerHandler(651045390, GuestHandler_CanGoBack_ParamsSpec.$, GuestHandler_CanGoBack_ResponseParamsSpec.$, this.canGoBack.createReceiverHandler(true /* expectsResponse */), false);
        this.goBack =
            new mojo.internal.interfaceSupport.InterfaceCallbackReceiver(this.router_);
        this.helper_internal_.registerHandler(176329721, GuestHandler_GoBack_ParamsSpec.$, null, this.goBack.createReceiverHandler(false /* expectsResponse */), false);
        this.canGoForward =
            new mojo.internal.interfaceSupport.InterfaceCallbackReceiver(this.router_);
        this.helper_internal_.registerHandler(887357769, GuestHandler_CanGoForward_ParamsSpec.$, GuestHandler_CanGoForward_ResponseParamsSpec.$, this.canGoForward.createReceiverHandler(true /* expectsResponse */), false);
        this.goForward =
            new mojo.internal.interfaceSupport.InterfaceCallbackReceiver(this.router_);
        this.helper_internal_.registerHandler(668625532, GuestHandler_GoForward_ParamsSpec.$, null, this.goForward.createReceiverHandler(false /* expectsResponse */), false);
        this.reload =
            new mojo.internal.interfaceSupport.InterfaceCallbackReceiver(this.router_);
        this.helper_internal_.registerHandler(1816165492, GuestHandler_Reload_ParamsSpec.$, null, this.reload.createReceiverHandler(false /* expectsResponse */), false);
        this.stopLoading =
            new mojo.internal.interfaceSupport.InterfaceCallbackReceiver(this.router_);
        this.helper_internal_.registerHandler(629685343, GuestHandler_StopLoading_ParamsSpec.$, null, this.stopLoading.createReceiverHandler(false /* expectsResponse */), false);
        this.openPageInfoMenu =
            new mojo.internal.interfaceSupport.InterfaceCallbackReceiver(this.router_);
        this.helper_internal_.registerHandler(1690373268, GuestHandler_OpenPageInfoMenu_ParamsSpec.$, null, this.openPageInfoMenu.createReceiverHandler(false /* expectsResponse */), false);
        this.getSecurityIcon =
            new mojo.internal.interfaceSupport.InterfaceCallbackReceiver(this.router_);
        this.helper_internal_.registerHandler(1589616709, GuestHandler_GetSecurityIcon_ParamsSpec.$, GuestHandler_GetSecurityIcon_ResponseParamsSpec.$, this.getSecurityIcon.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 PageHandlerFactory_CreatePageHandler_ParamsSpec = { $: {} };
export const Page_SetFocusToLocationBar_ParamsSpec = { $: {} };
export const Page_SetReloadStopState_ParamsSpec = { $: {} };
export const Page_ShowSidePanel_ParamsSpec = { $: {} };
export const Page_CloseSidePanel_ParamsSpec = { $: {} };
export const Page_OnFullscreenModeChanged_ParamsSpec = { $: {} };
export const Page_OnPaintAsActiveChanged_ParamsSpec = { $: {} };
export const PageHandler_GetGuestIdForTabId_ParamsSpec = { $: {} };
export const PageHandler_GetGuestIdForTabId_ResponseParamsSpec = { $: {} };
export const PageHandler_LoadTabSearch_ParamsSpec = { $: {} };
export const PageHandler_LoadTabSearch_ResponseParamsSpec = { $: {} };
export const PageHandler_ShowTabSearchBubble_ParamsSpec = { $: {} };
export const PageHandler_OpenAppMenu_ParamsSpec = { $: {} };
export const PageHandler_OpenProfileMenu_ParamsSpec = { $: {} };
export const PageHandler_LaunchDevToolsForBrowser_ParamsSpec = { $: {} };
export const PageHandler_OnSidePanelClosed_ParamsSpec = { $: {} };
export const PageHandler_Minimize_ParamsSpec = { $: {} };
export const PageHandler_Maximize_ParamsSpec = { $: {} };
export const PageHandler_Restore_ParamsSpec = { $: {} };
export const PageHandler_Close_ParamsSpec = { $: {} };
export const PageHandler_ShowBackForwardMenu_ParamsSpec = { $: {} };
export const PageHandler_GetTabStripInset_ParamsSpec = { $: {} };
export const PageHandler_GetTabStripInset_ResponseParamsSpec = { $: {} };
export const GuestHandler_Navigate_ParamsSpec = { $: {} };
export const GuestHandler_CanGoBack_ParamsSpec = { $: {} };
export const GuestHandler_CanGoBack_ResponseParamsSpec = { $: {} };
export const GuestHandler_GoBack_ParamsSpec = { $: {} };
export const GuestHandler_CanGoForward_ParamsSpec = { $: {} };
export const GuestHandler_CanGoForward_ResponseParamsSpec = { $: {} };
export const GuestHandler_GoForward_ParamsSpec = { $: {} };
export const GuestHandler_Reload_ParamsSpec = { $: {} };
export const GuestHandler_StopLoading_ParamsSpec = { $: {} };
export const GuestHandler_OpenPageInfoMenu_ParamsSpec = { $: {} };
export const GuestHandler_GetSecurityIcon_ParamsSpec = { $: {} };
export const GuestHandler_GetSecurityIcon_ResponseParamsSpec = { $: {} };
mojo.internal.Struct(PageHandlerFactory_CreatePageHandler_ParamsSpec.$, 'PageHandlerFactory_CreatePageHandler_Params', [
    mojo.internal.StructField('page', 0, 0, mojo.internal.InterfaceProxy(PageRemote), null, false /* nullable */, 0, undefined, undefined),
    mojo.internal.StructField('handler', 8, 0, mojo.internal.InterfaceRequest(PageHandlerPendingReceiver), null, false /* nullable */, 0, undefined, undefined),
], [[0, 24],]);
mojo.internal.Struct(Page_SetFocusToLocationBar_ParamsSpec.$, 'Page_SetFocusToLocationBar_Params', [
    mojo.internal.StructField('isUserInitiated', 0, 0, mojo.internal.Bool, false, false /* nullable */, 0, undefined, undefined),
], [[0, 16],]);
mojo.internal.Struct(Page_SetReloadStopState_ParamsSpec.$, 'Page_SetReloadStopState_Params', [
    mojo.internal.StructField('isLoading', 0, 0, mojo.internal.Bool, false, false /* nullable */, 0, undefined, undefined),
], [[0, 16],]);
mojo.internal.Struct(Page_ShowSidePanel_ParamsSpec.$, 'Page_ShowSidePanel_Params', [
    mojo.internal.StructField('guestContentsId', 0, 0, mojoBase_mojom_UnguessableTokenSpec.$, null, false /* nullable */, 0, undefined, undefined),
    mojo.internal.StructField('title', 8, 0, mojo.internal.String, null, false /* nullable */, 0, undefined, undefined),
], [[0, 24],]);
mojo.internal.Struct(Page_CloseSidePanel_ParamsSpec.$, 'Page_CloseSidePanel_Params', [], [[0, 8],]);
mojo.internal.Struct(Page_OnFullscreenModeChanged_ParamsSpec.$, 'Page_OnFullscreenModeChanged_Params', [
    mojo.internal.StructField('isFullscreen', 0, 0, mojo.internal.Bool, false, false /* nullable */, 0, undefined, undefined),
    mojo.internal.StructField('context_$flag', 0, 1, mojo.internal.Bool, false, false /* nullable */, 0, {
        isPrimary: true,
        linkedValueFieldName: "context_$value",
        originalFieldName: "context",
    }, undefined),
    mojo.internal.StructField('context_$value', 4, 0, FullscreenContextSpec.$, 0, false /* nullable */, 0, {
        isPrimary: false,
        originalFieldName: "context",
    }, undefined),
], [[0, 16],]);
mojo.internal.Struct(Page_OnPaintAsActiveChanged_ParamsSpec.$, 'Page_OnPaintAsActiveChanged_Params', [
    mojo.internal.StructField('active', 0, 0, mojo.internal.Bool, false, false /* nullable */, 0, undefined, undefined),
], [[0, 16],]);
mojo.internal.Struct(PageHandler_GetGuestIdForTabId_ParamsSpec.$, 'PageHandler_GetGuestIdForTabId_Params', [
    mojo.internal.StructField('tabId', 0, 0, tabsApi_mojom_NodeIdSpec.$, null, false /* nullable */, 0, undefined, undefined),
    mojo.internal.StructField('handler', 8, 0, mojo.internal.InterfaceRequest(GuestHandlerPendingReceiver), null, false /* nullable */, 0, undefined, undefined),
], [[0, 24],]);
mojo.internal.Struct(PageHandler_GetGuestIdForTabId_ResponseParamsSpec.$, 'PageHandler_GetGuestIdForTabId_ResponseParams', [
    mojo.internal.StructField('guestId', 0, 0, mojoBase_mojom_UnguessableTokenSpec.$, null, false /* nullable */, 0, undefined, undefined),
], [[0, 16],]);
mojo.internal.Struct(PageHandler_LoadTabSearch_ParamsSpec.$, 'PageHandler_LoadTabSearch_Params', [], [[0, 8],]);
mojo.internal.Struct(PageHandler_LoadTabSearch_ResponseParamsSpec.$, 'PageHandler_LoadTabSearch_ResponseParams', [
    mojo.internal.StructField('guestId', 0, 0, mojoBase_mojom_UnguessableTokenSpec.$, null, false /* nullable */, 0, undefined, undefined),
], [[0, 16],]);
mojo.internal.Struct(PageHandler_ShowTabSearchBubble_ParamsSpec.$, 'PageHandler_ShowTabSearchBubble_Params', [
    mojo.internal.StructField('anchorName', 0, 0, mojo.internal.String, null, false /* nullable */, 0, undefined, undefined),
], [[0, 16],]);
mojo.internal.Struct(PageHandler_OpenAppMenu_ParamsSpec.$, 'PageHandler_OpenAppMenu_Params', [], [[0, 8],]);
mojo.internal.Struct(PageHandler_OpenProfileMenu_ParamsSpec.$, 'PageHandler_OpenProfileMenu_Params', [], [[0, 8],]);
mojo.internal.Struct(PageHandler_LaunchDevToolsForBrowser_ParamsSpec.$, 'PageHandler_LaunchDevToolsForBrowser_Params', [], [[0, 8],]);
mojo.internal.Struct(PageHandler_OnSidePanelClosed_ParamsSpec.$, 'PageHandler_OnSidePanelClosed_Params', [], [[0, 8],]);
mojo.internal.Struct(PageHandler_Minimize_ParamsSpec.$, 'PageHandler_Minimize_Params', [], [[0, 8],]);
mojo.internal.Struct(PageHandler_Maximize_ParamsSpec.$, 'PageHandler_Maximize_Params', [], [[0, 8],]);
mojo.internal.Struct(PageHandler_Restore_ParamsSpec.$, 'PageHandler_Restore_Params', [], [[0, 8],]);
mojo.internal.Struct(PageHandler_Close_ParamsSpec.$, 'PageHandler_Close_Params', [], [[0, 8],]);
mojo.internal.Struct(PageHandler_ShowBackForwardMenu_ParamsSpec.$, 'PageHandler_ShowBackForwardMenu_Params', [
    mojo.internal.StructField('isBack', 0, 0, mojo.internal.Bool, false, false /* nullable */, 0, undefined, undefined),
], [[0, 16],]);
mojo.internal.Struct(PageHandler_GetTabStripInset_ParamsSpec.$, 'PageHandler_GetTabStripInset_Params', [], [[0, 8],]);
mojo.internal.Struct(PageHandler_GetTabStripInset_ResponseParamsSpec.$, 'PageHandler_GetTabStripInset_ResponseParams', [
    mojo.internal.StructField('width', 0, 0, mojo.internal.Int32, 0, false /* nullable */, 0, undefined, undefined),
], [[0, 16],]);
mojo.internal.Struct(GuestHandler_Navigate_ParamsSpec.$, 'GuestHandler_Navigate_Params', [
    mojo.internal.StructField('src', 0, 0, url_mojom_UrlSpec.$, null, false /* nullable */, 0, undefined, undefined),
], [[0, 16],]);
mojo.internal.Struct(GuestHandler_CanGoBack_ParamsSpec.$, 'GuestHandler_CanGoBack_Params', [], [[0, 8],]);
mojo.internal.Struct(GuestHandler_CanGoBack_ResponseParamsSpec.$, 'GuestHandler_CanGoBack_ResponseParams', [
    mojo.internal.StructField('canGoBack', 0, 0, mojo.internal.Bool, false, false /* nullable */, 0, undefined, undefined),
], [[0, 16],]);
mojo.internal.Struct(GuestHandler_GoBack_ParamsSpec.$, 'GuestHandler_GoBack_Params', [], [[0, 8],]);
mojo.internal.Struct(GuestHandler_CanGoForward_ParamsSpec.$, 'GuestHandler_CanGoForward_Params', [], [[0, 8],]);
mojo.internal.Struct(GuestHandler_CanGoForward_ResponseParamsSpec.$, 'GuestHandler_CanGoForward_ResponseParams', [
    mojo.internal.StructField('canGoForward', 0, 0, mojo.internal.Bool, false, false /* nullable */, 0, undefined, undefined),
], [[0, 16],]);
mojo.internal.Struct(GuestHandler_GoForward_ParamsSpec.$, 'GuestHandler_GoForward_Params', [], [[0, 8],]);
mojo.internal.Struct(GuestHandler_Reload_ParamsSpec.$, 'GuestHandler_Reload_Params', [], [[0, 8],]);
mojo.internal.Struct(GuestHandler_StopLoading_ParamsSpec.$, 'GuestHandler_StopLoading_Params', [], [[0, 8],]);
mojo.internal.Struct(GuestHandler_OpenPageInfoMenu_ParamsSpec.$, 'GuestHandler_OpenPageInfoMenu_Params', [], [[0, 8],]);
mojo.internal.Struct(GuestHandler_GetSecurityIcon_ParamsSpec.$, 'GuestHandler_GetSecurityIcon_Params', [], [[0, 8],]);
mojo.internal.Struct(GuestHandler_GetSecurityIcon_ResponseParamsSpec.$, 'GuestHandler_GetSecurityIcon_ResponseParams', [
    mojo.internal.StructField('securityIcon', 0, 0, SecurityIconSpec.$, 0, false /* nullable */, 0, undefined, undefined),
], [[0, 16],]);
export const browserProxyFactory = new MojoBrowserProxyFactory(PageHandlerRemote, PageCallbackRouter, (remote, receiver) => PageHandlerFactory.getRemote().createPageHandler(remote, receiver));
