// components/browser_apis/browser_controls/browser_controls_api.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 { EventDispositionFlagSpec as browserControlsApi_mojom_EventDispositionFlagSpec } from './browser_controls_api_data_model.mojom-webui.js';
import { EmptySpec as mojoBase_mojom_EmptySpec } from '//resources/mojo/mojo/public/mojom/base/empty.mojom-webui.js';
import { ErrorSpec as mojoBase_mojom_ErrorSpec } from '//resources/mojo/mojo/public/mojom/base/error.mojom-webui.js';
import { TimeDeltaSpec as mojoBase_mojom_TimeDeltaSpec } from '//resources/mojo/mojo/public/mojom/base/time.mojom-webui.js';
import { UrlSpec as url_mojom_UrlSpec } from '//resources/mojo/url/mojom/url.mojom-webui.js';
export const ReloadInputTypeSpec = { $: mojo.internal.Enum() };
export var ReloadInputType;
(function (ReloadInputType) {
    ReloadInputType[ReloadInputType["MIN_VALUE"] = 0] = "MIN_VALUE";
    ReloadInputType[ReloadInputType["MAX_VALUE"] = 2] = "MAX_VALUE";
    ReloadInputType[ReloadInputType["kUnspecified"] = 0] = "kUnspecified";
    ReloadInputType[ReloadInputType["kMouseRelease"] = 1] = "kMouseRelease";
    ReloadInputType[ReloadInputType["kKeyPress"] = 2] = "kKeyPress";
})(ReloadInputType || (ReloadInputType = {}));
export class BrowserControlsServicePendingReceiver {
    handle;
    constructor(handle) {
        this.handle = mojo.internal.interfaceSupport.getEndpointForReceiver(handle);
    }
    bindInBrowser(scope = 'context') {
        mojo.internal.interfaceSupport.bind(this.handle, 'browser_controls_api.mojom.BrowserControlsService', scope);
    }
}
export class BrowserControlsServiceRemote {
    proxy;
    $;
    onConnectionError;
    constructor(handle) {
        this.proxy =
            new mojo.internal.interfaceSupport.InterfaceRemoteBase(BrowserControlsServicePendingReceiver, handle);
        this.$ = new mojo.internal.interfaceSupport.InterfaceRemoteBaseWrapper(this.proxy);
        this.onConnectionError = this.proxy.getConnectionErrorEventRouter();
    }
    stopLoad() {
        return this.proxy.sendMessage(346926269, BrowserControlsService_StopLoad_ParamsSpec.$, BrowserControlsService_StopLoad_ResponseParamsSpec.$, [], true);
    }
    reloadFromClick(bypassCache, clickFlags, metadata) {
        return this.proxy.sendMessage(640496916, BrowserControlsService_ReloadFromClick_ParamsSpec.$, BrowserControlsService_ReloadFromClick_ResponseParamsSpec.$, [
            bypassCache,
            clickFlags,
            metadata
        ], true);
    }
    splitActiveTab() {
        return this.proxy.sendMessage(800044329, BrowserControlsService_SplitActiveTab_ParamsSpec.$, BrowserControlsService_SplitActiveTab_ResponseParamsSpec.$, [], true);
    }
    back(flags) {
        return this.proxy.sendMessage(1179310494, BrowserControlsService_Back_ParamsSpec.$, BrowserControlsService_Back_ResponseParamsSpec.$, [
            flags
        ], true);
    }
    forward(flags) {
        return this.proxy.sendMessage(609676536, BrowserControlsService_Forward_ParamsSpec.$, BrowserControlsService_Forward_ResponseParamsSpec.$, [
            flags
        ], true);
    }
    backButtonHovered() {
        return this.proxy.sendMessage(2111739068, BrowserControlsService_BackButtonHovered_ParamsSpec.$, BrowserControlsService_BackButtonHovered_ResponseParamsSpec.$, [], true);
    }
    navigateHome(clickFlags) {
        return this.proxy.sendMessage(52353743, BrowserControlsService_NavigateHome_ParamsSpec.$, BrowserControlsService_NavigateHome_ResponseParamsSpec.$, [
            clickFlags
        ], true);
    }
    navigate(url) {
        return this.proxy.sendMessage(1211546070, BrowserControlsService_Navigate_ParamsSpec.$, BrowserControlsService_Navigate_ResponseParamsSpec.$, [
            url
        ], true);
    }
    navigateText(text) {
        return this.proxy.sendMessage(1181385428, BrowserControlsService_NavigateText_ParamsSpec.$, BrowserControlsService_NavigateText_ResponseParamsSpec.$, [
            text
        ], true);
    }
}
;
/**
 * An object which receives request messages for the BrowserControlsService
 * mojom interface. Must be constructed over an object which implements that
 * interface.
 */
export class BrowserControlsServiceReceiver {
    helper_internal_;
    $;
    onConnectionError;
    constructor(impl) {
        this.helper_internal_ = new mojo.internal.interfaceSupport.InterfaceReceiverHelperInternal(BrowserControlsServiceRemote);
        this.$ = new mojo.internal.interfaceSupport.InterfaceReceiverHelper(this.helper_internal_);
        this.helper_internal_.registerHandler(346926269, BrowserControlsService_StopLoad_ParamsSpec.$, BrowserControlsService_StopLoad_ResponseParamsSpec.$, impl.stopLoad.bind(impl), true);
        this.helper_internal_.registerHandler(640496916, BrowserControlsService_ReloadFromClick_ParamsSpec.$, BrowserControlsService_ReloadFromClick_ResponseParamsSpec.$, impl.reloadFromClick.bind(impl), true);
        this.helper_internal_.registerHandler(800044329, BrowserControlsService_SplitActiveTab_ParamsSpec.$, BrowserControlsService_SplitActiveTab_ResponseParamsSpec.$, impl.splitActiveTab.bind(impl), true);
        this.helper_internal_.registerHandler(1179310494, BrowserControlsService_Back_ParamsSpec.$, BrowserControlsService_Back_ResponseParamsSpec.$, impl.back.bind(impl), true);
        this.helper_internal_.registerHandler(609676536, BrowserControlsService_Forward_ParamsSpec.$, BrowserControlsService_Forward_ResponseParamsSpec.$, impl.forward.bind(impl), true);
        this.helper_internal_.registerHandler(2111739068, BrowserControlsService_BackButtonHovered_ParamsSpec.$, BrowserControlsService_BackButtonHovered_ResponseParamsSpec.$, impl.backButtonHovered.bind(impl), true);
        this.helper_internal_.registerHandler(52353743, BrowserControlsService_NavigateHome_ParamsSpec.$, BrowserControlsService_NavigateHome_ResponseParamsSpec.$, impl.navigateHome.bind(impl), true);
        this.helper_internal_.registerHandler(1211546070, BrowserControlsService_Navigate_ParamsSpec.$, BrowserControlsService_Navigate_ResponseParamsSpec.$, impl.navigate.bind(impl), true);
        this.helper_internal_.registerHandler(1181385428, BrowserControlsService_NavigateText_ParamsSpec.$, BrowserControlsService_NavigateText_ResponseParamsSpec.$, impl.navigateText.bind(impl), true);
        this.onConnectionError = this.helper_internal_.getConnectionErrorEventRouter();
    }
}
export class BrowserControlsService {
    static get $interfaceName() {
        return "browser_controls_api.mojom.BrowserControlsService";
    }
    /**
     * 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 BrowserControlsServiceRemote;
        remote.$.bindNewPipeAndPassReceiver().bindInBrowser();
        return remote;
    }
}
/**
 * An object which receives request messages for the BrowserControlsService
 * 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 BrowserControlsServiceCallbackRouter {
    helper_internal_;
    $;
    router_;
    stopLoad;
    reloadFromClick;
    splitActiveTab;
    back;
    forward;
    backButtonHovered;
    navigateHome;
    navigate;
    navigateText;
    onConnectionError;
    constructor() {
        this.helper_internal_ = new mojo.internal.interfaceSupport.InterfaceReceiverHelperInternal(BrowserControlsServiceRemote);
        this.$ = new mojo.internal.interfaceSupport.InterfaceReceiverHelper(this.helper_internal_);
        this.router_ = new mojo.internal.interfaceSupport.CallbackRouter;
        this.stopLoad =
            new mojo.internal.interfaceSupport.InterfaceCallbackReceiver(this.router_);
        this.helper_internal_.registerHandler(346926269, BrowserControlsService_StopLoad_ParamsSpec.$, BrowserControlsService_StopLoad_ResponseParamsSpec.$, this.stopLoad.createReceiverHandler(true /* expectsResponse */), true);
        this.reloadFromClick =
            new mojo.internal.interfaceSupport.InterfaceCallbackReceiver(this.router_);
        this.helper_internal_.registerHandler(640496916, BrowserControlsService_ReloadFromClick_ParamsSpec.$, BrowserControlsService_ReloadFromClick_ResponseParamsSpec.$, this.reloadFromClick.createReceiverHandler(true /* expectsResponse */), true);
        this.splitActiveTab =
            new mojo.internal.interfaceSupport.InterfaceCallbackReceiver(this.router_);
        this.helper_internal_.registerHandler(800044329, BrowserControlsService_SplitActiveTab_ParamsSpec.$, BrowserControlsService_SplitActiveTab_ResponseParamsSpec.$, this.splitActiveTab.createReceiverHandler(true /* expectsResponse */), true);
        this.back =
            new mojo.internal.interfaceSupport.InterfaceCallbackReceiver(this.router_);
        this.helper_internal_.registerHandler(1179310494, BrowserControlsService_Back_ParamsSpec.$, BrowserControlsService_Back_ResponseParamsSpec.$, this.back.createReceiverHandler(true /* expectsResponse */), true);
        this.forward =
            new mojo.internal.interfaceSupport.InterfaceCallbackReceiver(this.router_);
        this.helper_internal_.registerHandler(609676536, BrowserControlsService_Forward_ParamsSpec.$, BrowserControlsService_Forward_ResponseParamsSpec.$, this.forward.createReceiverHandler(true /* expectsResponse */), true);
        this.backButtonHovered =
            new mojo.internal.interfaceSupport.InterfaceCallbackReceiver(this.router_);
        this.helper_internal_.registerHandler(2111739068, BrowserControlsService_BackButtonHovered_ParamsSpec.$, BrowserControlsService_BackButtonHovered_ResponseParamsSpec.$, this.backButtonHovered.createReceiverHandler(true /* expectsResponse */), true);
        this.navigateHome =
            new mojo.internal.interfaceSupport.InterfaceCallbackReceiver(this.router_);
        this.helper_internal_.registerHandler(52353743, BrowserControlsService_NavigateHome_ParamsSpec.$, BrowserControlsService_NavigateHome_ResponseParamsSpec.$, this.navigateHome.createReceiverHandler(true /* expectsResponse */), true);
        this.navigate =
            new mojo.internal.interfaceSupport.InterfaceCallbackReceiver(this.router_);
        this.helper_internal_.registerHandler(1211546070, BrowserControlsService_Navigate_ParamsSpec.$, BrowserControlsService_Navigate_ResponseParamsSpec.$, this.navigate.createReceiverHandler(true /* expectsResponse */), true);
        this.navigateText =
            new mojo.internal.interfaceSupport.InterfaceCallbackReceiver(this.router_);
        this.helper_internal_.registerHandler(1181385428, BrowserControlsService_NavigateText_ParamsSpec.$, BrowserControlsService_NavigateText_ResponseParamsSpec.$, this.navigateText.createReceiverHandler(true /* expectsResponse */), true);
        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 ReloadInteractionMetadataSpec = { $: {} };
export const BrowserControlsService_StopLoad_ParamsSpec = { $: {} };
export const BrowserControlsService_StopLoad_ResponseParamsSpec = { $: {} };
export const BrowserControlsService_ReloadFromClick_ParamsSpec = { $: {} };
export const BrowserControlsService_ReloadFromClick_ResponseParamsSpec = { $: {} };
export const BrowserControlsService_SplitActiveTab_ParamsSpec = { $: {} };
export const BrowserControlsService_SplitActiveTab_ResponseParamsSpec = { $: {} };
export const BrowserControlsService_Back_ParamsSpec = { $: {} };
export const BrowserControlsService_Back_ResponseParamsSpec = { $: {} };
export const BrowserControlsService_Forward_ParamsSpec = { $: {} };
export const BrowserControlsService_Forward_ResponseParamsSpec = { $: {} };
export const BrowserControlsService_BackButtonHovered_ParamsSpec = { $: {} };
export const BrowserControlsService_BackButtonHovered_ResponseParamsSpec = { $: {} };
export const BrowserControlsService_NavigateHome_ParamsSpec = { $: {} };
export const BrowserControlsService_NavigateHome_ResponseParamsSpec = { $: {} };
export const BrowserControlsService_Navigate_ParamsSpec = { $: {} };
export const BrowserControlsService_Navigate_ResponseParamsSpec = { $: {} };
export const BrowserControlsService_NavigateText_ParamsSpec = { $: {} };
export const BrowserControlsService_NavigateText_ResponseParamsSpec = { $: {} };
export const BrowserControlsService_StopLoad_ResponseParam_ResultSpec = { $: {} };
export const BrowserControlsService_ReloadFromClick_ResponseParam_ResultSpec = { $: {} };
export const BrowserControlsService_SplitActiveTab_ResponseParam_ResultSpec = { $: {} };
export const BrowserControlsService_Back_ResponseParam_ResultSpec = { $: {} };
export const BrowserControlsService_Forward_ResponseParam_ResultSpec = { $: {} };
export const BrowserControlsService_BackButtonHovered_ResponseParam_ResultSpec = { $: {} };
export const BrowserControlsService_NavigateHome_ResponseParam_ResultSpec = { $: {} };
export const BrowserControlsService_Navigate_ResponseParam_ResultSpec = { $: {} };
export const BrowserControlsService_NavigateText_ResponseParam_ResultSpec = { $: {} };
mojo.internal.Struct(ReloadInteractionMetadataSpec.$, 'ReloadInteractionMetadata', [
    mojo.internal.StructField('interactionTimeOffset', 0, 0, mojoBase_mojom_TimeDeltaSpec.$, null, false /* nullable */, 0, undefined, undefined),
    mojo.internal.StructField('inputType', 8, 0, ReloadInputTypeSpec.$, 0, false /* nullable */, 0, undefined, undefined),
], [[0, 24],]);
mojo.internal.Struct(BrowserControlsService_StopLoad_ParamsSpec.$, 'BrowserControlsService_StopLoad_Params', [], [[0, 8],]);
mojo.internal.Struct(BrowserControlsService_StopLoad_ResponseParamsSpec.$, 'BrowserControlsService_StopLoad_ResponseParams', [
    mojo.internal.StructField('result', 0, 0, BrowserControlsService_StopLoad_ResponseParam_ResultSpec.$, null, false /* nullable */, 0, undefined, undefined),
], [[0, 24],]);
mojo.internal.Struct(BrowserControlsService_ReloadFromClick_ParamsSpec.$, 'BrowserControlsService_ReloadFromClick_Params', [
    mojo.internal.StructField('bypassCache', 0, 0, mojo.internal.Bool, false, false /* nullable */, 0, undefined, undefined),
    mojo.internal.StructField('clickFlags', 8, 0, mojo.internal.Array(browserControlsApi_mojom_EventDispositionFlagSpec.$, false), null, false /* nullable */, 0, undefined, undefined),
    mojo.internal.StructField('metadata', 16, 0, ReloadInteractionMetadataSpec.$, null, true /* nullable */, 0, undefined, undefined),
], [[0, 32],]);
mojo.internal.Struct(BrowserControlsService_ReloadFromClick_ResponseParamsSpec.$, 'BrowserControlsService_ReloadFromClick_ResponseParams', [
    mojo.internal.StructField('result', 0, 0, BrowserControlsService_ReloadFromClick_ResponseParam_ResultSpec.$, null, false /* nullable */, 0, undefined, undefined),
], [[0, 24],]);
mojo.internal.Struct(BrowserControlsService_SplitActiveTab_ParamsSpec.$, 'BrowserControlsService_SplitActiveTab_Params', [], [[0, 8],]);
mojo.internal.Struct(BrowserControlsService_SplitActiveTab_ResponseParamsSpec.$, 'BrowserControlsService_SplitActiveTab_ResponseParams', [
    mojo.internal.StructField('result', 0, 0, BrowserControlsService_SplitActiveTab_ResponseParam_ResultSpec.$, null, false /* nullable */, 0, undefined, undefined),
], [[0, 24],]);
mojo.internal.Struct(BrowserControlsService_Back_ParamsSpec.$, 'BrowserControlsService_Back_Params', [
    mojo.internal.StructField('flags', 0, 0, mojo.internal.Array(browserControlsApi_mojom_EventDispositionFlagSpec.$, false), null, false /* nullable */, 0, undefined, undefined),
], [[0, 16],]);
mojo.internal.Struct(BrowserControlsService_Back_ResponseParamsSpec.$, 'BrowserControlsService_Back_ResponseParams', [
    mojo.internal.StructField('result', 0, 0, BrowserControlsService_Back_ResponseParam_ResultSpec.$, null, false /* nullable */, 0, undefined, undefined),
], [[0, 24],]);
mojo.internal.Struct(BrowserControlsService_Forward_ParamsSpec.$, 'BrowserControlsService_Forward_Params', [
    mojo.internal.StructField('flags', 0, 0, mojo.internal.Array(browserControlsApi_mojom_EventDispositionFlagSpec.$, false), null, false /* nullable */, 0, undefined, undefined),
], [[0, 16],]);
mojo.internal.Struct(BrowserControlsService_Forward_ResponseParamsSpec.$, 'BrowserControlsService_Forward_ResponseParams', [
    mojo.internal.StructField('result', 0, 0, BrowserControlsService_Forward_ResponseParam_ResultSpec.$, null, false /* nullable */, 0, undefined, undefined),
], [[0, 24],]);
mojo.internal.Struct(BrowserControlsService_BackButtonHovered_ParamsSpec.$, 'BrowserControlsService_BackButtonHovered_Params', [], [[0, 8],]);
mojo.internal.Struct(BrowserControlsService_BackButtonHovered_ResponseParamsSpec.$, 'BrowserControlsService_BackButtonHovered_ResponseParams', [
    mojo.internal.StructField('result', 0, 0, BrowserControlsService_BackButtonHovered_ResponseParam_ResultSpec.$, null, false /* nullable */, 0, undefined, undefined),
], [[0, 24],]);
mojo.internal.Struct(BrowserControlsService_NavigateHome_ParamsSpec.$, 'BrowserControlsService_NavigateHome_Params', [
    mojo.internal.StructField('clickFlags', 0, 0, mojo.internal.Array(browserControlsApi_mojom_EventDispositionFlagSpec.$, false), null, false /* nullable */, 0, undefined, undefined),
], [[0, 16],]);
mojo.internal.Struct(BrowserControlsService_NavigateHome_ResponseParamsSpec.$, 'BrowserControlsService_NavigateHome_ResponseParams', [
    mojo.internal.StructField('result', 0, 0, BrowserControlsService_NavigateHome_ResponseParam_ResultSpec.$, null, false /* nullable */, 0, undefined, undefined),
], [[0, 24],]);
mojo.internal.Struct(BrowserControlsService_Navigate_ParamsSpec.$, 'BrowserControlsService_Navigate_Params', [
    mojo.internal.StructField('url', 0, 0, url_mojom_UrlSpec.$, null, false /* nullable */, 0, undefined, undefined),
], [[0, 16],]);
mojo.internal.Struct(BrowserControlsService_Navigate_ResponseParamsSpec.$, 'BrowserControlsService_Navigate_ResponseParams', [
    mojo.internal.StructField('result', 0, 0, BrowserControlsService_Navigate_ResponseParam_ResultSpec.$, null, false /* nullable */, 0, undefined, undefined),
], [[0, 24],]);
mojo.internal.Struct(BrowserControlsService_NavigateText_ParamsSpec.$, 'BrowserControlsService_NavigateText_Params', [
    mojo.internal.StructField('text', 0, 0, mojo.internal.String, null, false /* nullable */, 0, undefined, undefined),
], [[0, 16],]);
mojo.internal.Struct(BrowserControlsService_NavigateText_ResponseParamsSpec.$, 'BrowserControlsService_NavigateText_ResponseParams', [
    mojo.internal.StructField('result', 0, 0, BrowserControlsService_NavigateText_ResponseParam_ResultSpec.$, null, false /* nullable */, 0, undefined, undefined),
], [[0, 24],]);
mojo.internal.Union(BrowserControlsService_StopLoad_ResponseParam_ResultSpec.$, 'BrowserControlsService_StopLoad_ResponseParam_Result', {
    'success': {
        'ordinal': 0,
        'type': mojoBase_mojom_EmptySpec.$,
    },
    'failure': {
        'ordinal': 1,
        'type': mojoBase_mojom_ErrorSpec.$,
    },
});
export var BrowserControlsService_StopLoad_ResponseParam_ResultFieldTags;
(function (BrowserControlsService_StopLoad_ResponseParam_ResultFieldTags) {
    BrowserControlsService_StopLoad_ResponseParam_ResultFieldTags[BrowserControlsService_StopLoad_ResponseParam_ResultFieldTags["SUCCESS"] = 0] = "SUCCESS";
    BrowserControlsService_StopLoad_ResponseParam_ResultFieldTags[BrowserControlsService_StopLoad_ResponseParam_ResultFieldTags["FAILURE"] = 1] = "FAILURE";
})(BrowserControlsService_StopLoad_ResponseParam_ResultFieldTags || (BrowserControlsService_StopLoad_ResponseParam_ResultFieldTags = {}));
export function whichBrowserControlsService_StopLoad_ResponseParam_Result(u) {
    if (u.success !== null && u.success !== undefined) {
        return BrowserControlsService_StopLoad_ResponseParam_ResultFieldTags.SUCCESS;
    }
    if (u.failure !== null && u.failure !== undefined) {
        return BrowserControlsService_StopLoad_ResponseParam_ResultFieldTags.FAILURE;
    }
    throw new Error("no union field has been set, this is an illegal state");
}
mojo.internal.Union(BrowserControlsService_ReloadFromClick_ResponseParam_ResultSpec.$, 'BrowserControlsService_ReloadFromClick_ResponseParam_Result', {
    'success': {
        'ordinal': 0,
        'type': mojoBase_mojom_EmptySpec.$,
    },
    'failure': {
        'ordinal': 1,
        'type': mojoBase_mojom_ErrorSpec.$,
    },
});
export var BrowserControlsService_ReloadFromClick_ResponseParam_ResultFieldTags;
(function (BrowserControlsService_ReloadFromClick_ResponseParam_ResultFieldTags) {
    BrowserControlsService_ReloadFromClick_ResponseParam_ResultFieldTags[BrowserControlsService_ReloadFromClick_ResponseParam_ResultFieldTags["SUCCESS"] = 0] = "SUCCESS";
    BrowserControlsService_ReloadFromClick_ResponseParam_ResultFieldTags[BrowserControlsService_ReloadFromClick_ResponseParam_ResultFieldTags["FAILURE"] = 1] = "FAILURE";
})(BrowserControlsService_ReloadFromClick_ResponseParam_ResultFieldTags || (BrowserControlsService_ReloadFromClick_ResponseParam_ResultFieldTags = {}));
export function whichBrowserControlsService_ReloadFromClick_ResponseParam_Result(u) {
    if (u.success !== null && u.success !== undefined) {
        return BrowserControlsService_ReloadFromClick_ResponseParam_ResultFieldTags.SUCCESS;
    }
    if (u.failure !== null && u.failure !== undefined) {
        return BrowserControlsService_ReloadFromClick_ResponseParam_ResultFieldTags.FAILURE;
    }
    throw new Error("no union field has been set, this is an illegal state");
}
mojo.internal.Union(BrowserControlsService_SplitActiveTab_ResponseParam_ResultSpec.$, 'BrowserControlsService_SplitActiveTab_ResponseParam_Result', {
    'success': {
        'ordinal': 0,
        'type': mojoBase_mojom_EmptySpec.$,
    },
    'failure': {
        'ordinal': 1,
        'type': mojoBase_mojom_ErrorSpec.$,
    },
});
export var BrowserControlsService_SplitActiveTab_ResponseParam_ResultFieldTags;
(function (BrowserControlsService_SplitActiveTab_ResponseParam_ResultFieldTags) {
    BrowserControlsService_SplitActiveTab_ResponseParam_ResultFieldTags[BrowserControlsService_SplitActiveTab_ResponseParam_ResultFieldTags["SUCCESS"] = 0] = "SUCCESS";
    BrowserControlsService_SplitActiveTab_ResponseParam_ResultFieldTags[BrowserControlsService_SplitActiveTab_ResponseParam_ResultFieldTags["FAILURE"] = 1] = "FAILURE";
})(BrowserControlsService_SplitActiveTab_ResponseParam_ResultFieldTags || (BrowserControlsService_SplitActiveTab_ResponseParam_ResultFieldTags = {}));
export function whichBrowserControlsService_SplitActiveTab_ResponseParam_Result(u) {
    if (u.success !== null && u.success !== undefined) {
        return BrowserControlsService_SplitActiveTab_ResponseParam_ResultFieldTags.SUCCESS;
    }
    if (u.failure !== null && u.failure !== undefined) {
        return BrowserControlsService_SplitActiveTab_ResponseParam_ResultFieldTags.FAILURE;
    }
    throw new Error("no union field has been set, this is an illegal state");
}
mojo.internal.Union(BrowserControlsService_Back_ResponseParam_ResultSpec.$, 'BrowserControlsService_Back_ResponseParam_Result', {
    'success': {
        'ordinal': 0,
        'type': mojoBase_mojom_EmptySpec.$,
    },
    'failure': {
        'ordinal': 1,
        'type': mojoBase_mojom_ErrorSpec.$,
    },
});
export var BrowserControlsService_Back_ResponseParam_ResultFieldTags;
(function (BrowserControlsService_Back_ResponseParam_ResultFieldTags) {
    BrowserControlsService_Back_ResponseParam_ResultFieldTags[BrowserControlsService_Back_ResponseParam_ResultFieldTags["SUCCESS"] = 0] = "SUCCESS";
    BrowserControlsService_Back_ResponseParam_ResultFieldTags[BrowserControlsService_Back_ResponseParam_ResultFieldTags["FAILURE"] = 1] = "FAILURE";
})(BrowserControlsService_Back_ResponseParam_ResultFieldTags || (BrowserControlsService_Back_ResponseParam_ResultFieldTags = {}));
export function whichBrowserControlsService_Back_ResponseParam_Result(u) {
    if (u.success !== null && u.success !== undefined) {
        return BrowserControlsService_Back_ResponseParam_ResultFieldTags.SUCCESS;
    }
    if (u.failure !== null && u.failure !== undefined) {
        return BrowserControlsService_Back_ResponseParam_ResultFieldTags.FAILURE;
    }
    throw new Error("no union field has been set, this is an illegal state");
}
mojo.internal.Union(BrowserControlsService_Forward_ResponseParam_ResultSpec.$, 'BrowserControlsService_Forward_ResponseParam_Result', {
    'success': {
        'ordinal': 0,
        'type': mojoBase_mojom_EmptySpec.$,
    },
    'failure': {
        'ordinal': 1,
        'type': mojoBase_mojom_ErrorSpec.$,
    },
});
export var BrowserControlsService_Forward_ResponseParam_ResultFieldTags;
(function (BrowserControlsService_Forward_ResponseParam_ResultFieldTags) {
    BrowserControlsService_Forward_ResponseParam_ResultFieldTags[BrowserControlsService_Forward_ResponseParam_ResultFieldTags["SUCCESS"] = 0] = "SUCCESS";
    BrowserControlsService_Forward_ResponseParam_ResultFieldTags[BrowserControlsService_Forward_ResponseParam_ResultFieldTags["FAILURE"] = 1] = "FAILURE";
})(BrowserControlsService_Forward_ResponseParam_ResultFieldTags || (BrowserControlsService_Forward_ResponseParam_ResultFieldTags = {}));
export function whichBrowserControlsService_Forward_ResponseParam_Result(u) {
    if (u.success !== null && u.success !== undefined) {
        return BrowserControlsService_Forward_ResponseParam_ResultFieldTags.SUCCESS;
    }
    if (u.failure !== null && u.failure !== undefined) {
        return BrowserControlsService_Forward_ResponseParam_ResultFieldTags.FAILURE;
    }
    throw new Error("no union field has been set, this is an illegal state");
}
mojo.internal.Union(BrowserControlsService_BackButtonHovered_ResponseParam_ResultSpec.$, 'BrowserControlsService_BackButtonHovered_ResponseParam_Result', {
    'success': {
        'ordinal': 0,
        'type': mojoBase_mojom_EmptySpec.$,
    },
    'failure': {
        'ordinal': 1,
        'type': mojoBase_mojom_ErrorSpec.$,
    },
});
export var BrowserControlsService_BackButtonHovered_ResponseParam_ResultFieldTags;
(function (BrowserControlsService_BackButtonHovered_ResponseParam_ResultFieldTags) {
    BrowserControlsService_BackButtonHovered_ResponseParam_ResultFieldTags[BrowserControlsService_BackButtonHovered_ResponseParam_ResultFieldTags["SUCCESS"] = 0] = "SUCCESS";
    BrowserControlsService_BackButtonHovered_ResponseParam_ResultFieldTags[BrowserControlsService_BackButtonHovered_ResponseParam_ResultFieldTags["FAILURE"] = 1] = "FAILURE";
})(BrowserControlsService_BackButtonHovered_ResponseParam_ResultFieldTags || (BrowserControlsService_BackButtonHovered_ResponseParam_ResultFieldTags = {}));
export function whichBrowserControlsService_BackButtonHovered_ResponseParam_Result(u) {
    if (u.success !== null && u.success !== undefined) {
        return BrowserControlsService_BackButtonHovered_ResponseParam_ResultFieldTags.SUCCESS;
    }
    if (u.failure !== null && u.failure !== undefined) {
        return BrowserControlsService_BackButtonHovered_ResponseParam_ResultFieldTags.FAILURE;
    }
    throw new Error("no union field has been set, this is an illegal state");
}
mojo.internal.Union(BrowserControlsService_NavigateHome_ResponseParam_ResultSpec.$, 'BrowserControlsService_NavigateHome_ResponseParam_Result', {
    'success': {
        'ordinal': 0,
        'type': mojoBase_mojom_EmptySpec.$,
    },
    'failure': {
        'ordinal': 1,
        'type': mojoBase_mojom_ErrorSpec.$,
    },
});
export var BrowserControlsService_NavigateHome_ResponseParam_ResultFieldTags;
(function (BrowserControlsService_NavigateHome_ResponseParam_ResultFieldTags) {
    BrowserControlsService_NavigateHome_ResponseParam_ResultFieldTags[BrowserControlsService_NavigateHome_ResponseParam_ResultFieldTags["SUCCESS"] = 0] = "SUCCESS";
    BrowserControlsService_NavigateHome_ResponseParam_ResultFieldTags[BrowserControlsService_NavigateHome_ResponseParam_ResultFieldTags["FAILURE"] = 1] = "FAILURE";
})(BrowserControlsService_NavigateHome_ResponseParam_ResultFieldTags || (BrowserControlsService_NavigateHome_ResponseParam_ResultFieldTags = {}));
export function whichBrowserControlsService_NavigateHome_ResponseParam_Result(u) {
    if (u.success !== null && u.success !== undefined) {
        return BrowserControlsService_NavigateHome_ResponseParam_ResultFieldTags.SUCCESS;
    }
    if (u.failure !== null && u.failure !== undefined) {
        return BrowserControlsService_NavigateHome_ResponseParam_ResultFieldTags.FAILURE;
    }
    throw new Error("no union field has been set, this is an illegal state");
}
mojo.internal.Union(BrowserControlsService_Navigate_ResponseParam_ResultSpec.$, 'BrowserControlsService_Navigate_ResponseParam_Result', {
    'success': {
        'ordinal': 0,
        'type': mojoBase_mojom_EmptySpec.$,
    },
    'failure': {
        'ordinal': 1,
        'type': mojoBase_mojom_ErrorSpec.$,
    },
});
export var BrowserControlsService_Navigate_ResponseParam_ResultFieldTags;
(function (BrowserControlsService_Navigate_ResponseParam_ResultFieldTags) {
    BrowserControlsService_Navigate_ResponseParam_ResultFieldTags[BrowserControlsService_Navigate_ResponseParam_ResultFieldTags["SUCCESS"] = 0] = "SUCCESS";
    BrowserControlsService_Navigate_ResponseParam_ResultFieldTags[BrowserControlsService_Navigate_ResponseParam_ResultFieldTags["FAILURE"] = 1] = "FAILURE";
})(BrowserControlsService_Navigate_ResponseParam_ResultFieldTags || (BrowserControlsService_Navigate_ResponseParam_ResultFieldTags = {}));
export function whichBrowserControlsService_Navigate_ResponseParam_Result(u) {
    if (u.success !== null && u.success !== undefined) {
        return BrowserControlsService_Navigate_ResponseParam_ResultFieldTags.SUCCESS;
    }
    if (u.failure !== null && u.failure !== undefined) {
        return BrowserControlsService_Navigate_ResponseParam_ResultFieldTags.FAILURE;
    }
    throw new Error("no union field has been set, this is an illegal state");
}
mojo.internal.Union(BrowserControlsService_NavigateText_ResponseParam_ResultSpec.$, 'BrowserControlsService_NavigateText_ResponseParam_Result', {
    'success': {
        'ordinal': 0,
        'type': mojoBase_mojom_EmptySpec.$,
    },
    'failure': {
        'ordinal': 1,
        'type': mojoBase_mojom_ErrorSpec.$,
    },
});
export var BrowserControlsService_NavigateText_ResponseParam_ResultFieldTags;
(function (BrowserControlsService_NavigateText_ResponseParam_ResultFieldTags) {
    BrowserControlsService_NavigateText_ResponseParam_ResultFieldTags[BrowserControlsService_NavigateText_ResponseParam_ResultFieldTags["SUCCESS"] = 0] = "SUCCESS";
    BrowserControlsService_NavigateText_ResponseParam_ResultFieldTags[BrowserControlsService_NavigateText_ResponseParam_ResultFieldTags["FAILURE"] = 1] = "FAILURE";
})(BrowserControlsService_NavigateText_ResponseParam_ResultFieldTags || (BrowserControlsService_NavigateText_ResponseParam_ResultFieldTags = {}));
export function whichBrowserControlsService_NavigateText_ResponseParam_Result(u) {
    if (u.success !== null && u.success !== undefined) {
        return BrowserControlsService_NavigateText_ResponseParam_ResultFieldTags.SUCCESS;
    }
    if (u.failure !== null && u.failure !== undefined) {
        return BrowserControlsService_NavigateText_ResponseParam_ResultFieldTags.FAILURE;
    }
    throw new Error("no union field has been set, this is an illegal state");
}
