| // chrome/browser/ui/webui/image_editor/image_editor.mojom-lite.js is auto generated by mojom_bindings_generator.py, do not edit |
| |
| // Copyright 2018 The Chromium Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| 'use strict'; |
| |
| |
| mojo.internal.exportModule('imageEditor.mojom'); |
| |
| |
| |
| |
| |
| /** |
| * @const { {$: !mojo.internal.MojomType} } |
| * @export |
| */ |
| imageEditor.mojom.EditActionSpec = { $: mojo.internal.Enum() }; |
| |
| /** |
| * @enum {number} |
| * @export |
| */ |
| imageEditor.mojom.EditAction = { |
| |
| kToolCrop: 0, |
| kToolText: 1, |
| kToolDraw: 2, |
| kToolCircle: 3, |
| kToolRect: 4, |
| kToolLine: 5, |
| kToolArrow: 6, |
| kToolEmoji: 7, |
| kToolHighlight: 8, |
| kZoomIn: 9, |
| kZoomOut: 10, |
| kCopy: 11, |
| kSave: 12, |
| kShare: 13, |
| kTextColorChnage: 14, |
| kTextFontChange: 15, |
| kTextSizeChange: 16, |
| kDrawSizeChange: 17, |
| kDrawColorChange: 18, |
| kHighlightColorChange: 19, |
| kFallbackLaunched: 20, |
| MIN_VALUE: 0, |
| MAX_VALUE: 20, |
| }; |
| |
| |
| |
| |
| |
| /** |
| * @implements {mojo.internal.interfaceSupport.PendingReceiver} |
| * @export |
| */ |
| imageEditor.mojom.ImageEditorHandlerPendingReceiver = class { |
| /** |
| * @param {!MojoHandle|!mojo.internal.interfaceSupport.Endpoint} handle |
| */ |
| constructor(handle) { |
| /** @public {!mojo.internal.interfaceSupport.Endpoint} */ |
| this.handle = mojo.internal.interfaceSupport.getEndpointForReceiver(handle); |
| } |
| |
| /** @param {string=} scope */ |
| bindInBrowser(scope = 'context') { |
| mojo.internal.interfaceSupport.bind( |
| this.handle, |
| imageEditor.mojom.ImageEditorHandler.$interfaceName, |
| scope); |
| } |
| }; |
| |
| |
| |
| /** |
| * @export |
| * @implements { imageEditor.mojom.ImageEditorHandlerInterface } |
| */ |
| imageEditor.mojom.ImageEditorHandlerRemote = class { |
| /** @param {MojoHandle|mojo.internal.interfaceSupport.Endpoint=} handle */ |
| constructor(handle = undefined) { |
| /** |
| * @private {!mojo.internal.interfaceSupport.InterfaceRemoteBase<!imageEditor.mojom.ImageEditorHandlerPendingReceiver>} |
| */ |
| this.proxy = |
| new mojo.internal.interfaceSupport.InterfaceRemoteBase( |
| imageEditor.mojom.ImageEditorHandlerPendingReceiver, |
| handle); |
| |
| /** |
| * @public {!mojo.internal.interfaceSupport.InterfaceRemoteBaseWrapper<!imageEditor.mojom.ImageEditorHandlerPendingReceiver>} |
| */ |
| this.$ = new mojo.internal.interfaceSupport.InterfaceRemoteBaseWrapper(this.proxy); |
| |
| /** @public {!mojo.internal.interfaceSupport.ConnectionErrorEventRouter} */ |
| this.onConnectionError = this.proxy.getConnectionErrorEventRouter(); |
| } |
| |
| |
| /** |
| * @param { !imageEditor.mojom.EditAction } action |
| */ |
| |
| recordUserAction( |
| action) { |
| this.proxy.sendMessage( |
| 894926103, |
| imageEditor.mojom.ImageEditorHandler_RecordUserAction_ParamsSpec.$, |
| null, |
| [ |
| action |
| ]); |
| } |
| }; |
| |
| /** |
| * An object which receives request messages for the ImageEditorHandler |
| * mojom interface. Must be constructed over an object which implements that |
| * interface. |
| * |
| * @export |
| */ |
| imageEditor.mojom.ImageEditorHandlerReceiver = class { |
| /** |
| * @param {!imageEditor.mojom.ImageEditorHandlerInterface } impl |
| */ |
| constructor(impl) { |
| /** @private {!mojo.internal.interfaceSupport.InterfaceReceiverHelperInternal<!imageEditor.mojom.ImageEditorHandlerRemote>} */ |
| this.helper_internal_ = new mojo.internal.interfaceSupport.InterfaceReceiverHelperInternal( |
| imageEditor.mojom.ImageEditorHandlerRemote); |
| |
| /** |
| * @public {!mojo.internal.interfaceSupport.InterfaceReceiverHelper<!imageEditor.mojom.ImageEditorHandlerRemote>} |
| */ |
| this.$ = new mojo.internal.interfaceSupport.InterfaceReceiverHelper(this.helper_internal_); |
| |
| |
| this.helper_internal_.registerHandler( |
| 894926103, |
| imageEditor.mojom.ImageEditorHandler_RecordUserAction_ParamsSpec.$, |
| null, |
| impl.recordUserAction.bind(impl)); |
| /** @public {!mojo.internal.interfaceSupport.ConnectionErrorEventRouter} */ |
| this.onConnectionError = this.helper_internal_.getConnectionErrorEventRouter(); |
| } |
| }; |
| |
| /** |
| * @export |
| */ |
| imageEditor.mojom.ImageEditorHandler = class { |
| /** |
| * @return {!string} |
| */ |
| static get $interfaceName() { |
| return "image_editor.mojom.ImageEditorHandler"; |
| } |
| |
| /** |
| * 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. |
| * |
| * @return {!imageEditor.mojom.ImageEditorHandlerRemote} |
| * @export |
| */ |
| static getRemote() { |
| let remote = new imageEditor.mojom.ImageEditorHandlerRemote; |
| remote.$.bindNewPipeAndPassReceiver().bindInBrowser(); |
| return remote; |
| } |
| }; |
| |
| |
| /** |
| * An object which receives request messages for the ImageEditorHandler |
| * 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 |
| */ |
| imageEditor.mojom.ImageEditorHandlerCallbackRouter = class { |
| constructor() { |
| this.helper_internal_ = new mojo.internal.interfaceSupport.InterfaceReceiverHelperInternal( |
| imageEditor.mojom.ImageEditorHandlerRemote); |
| |
| /** |
| * @public {!mojo.internal.interfaceSupport.InterfaceReceiverHelper<!imageEditor.mojom.ImageEditorHandlerRemote>} |
| */ |
| this.$ = new mojo.internal.interfaceSupport.InterfaceReceiverHelper(this.helper_internal_); |
| |
| this.router_ = new mojo.internal.interfaceSupport.CallbackRouter; |
| |
| /** |
| * @public {!mojo.internal.interfaceSupport.InterfaceCallbackReceiver} |
| */ |
| this.recordUserAction = |
| new mojo.internal.interfaceSupport.InterfaceCallbackReceiver( |
| this.router_); |
| |
| this.helper_internal_.registerHandler( |
| 894926103, |
| imageEditor.mojom.ImageEditorHandler_RecordUserAction_ParamsSpec.$, |
| null, |
| this.recordUserAction.createReceiverHandler(false /* expectsResponse */)); |
| /** @public {!mojo.internal.interfaceSupport.ConnectionErrorEventRouter} */ |
| this.onConnectionError = this.helper_internal_.getConnectionErrorEventRouter(); |
| } |
| |
| /** |
| * @param {number} id An ID returned by a prior call to addListener. |
| * @return {boolean} True iff the identified listener was found and removed. |
| * @export |
| */ |
| removeListener(id) { |
| return this.router_.removeListener(id); |
| } |
| }; |
| |
| |
| |
| /** |
| * @const { {$:!mojo.internal.MojomType}} |
| * @export |
| */ |
| imageEditor.mojom.ImageEditorHandler_RecordUserAction_ParamsSpec = |
| { $: /** @type {!mojo.internal.MojomType} */ ({}) }; |
| |
| |
| |
| |
| mojo.internal.Struct( |
| imageEditor.mojom.ImageEditorHandler_RecordUserAction_ParamsSpec.$, |
| 'ImageEditorHandler_RecordUserAction_Params', |
| [ |
| mojo.internal.StructField( |
| 'action', 0, |
| 0, |
| imageEditor.mojom.EditActionSpec.$, |
| 0, |
| false /* nullable */), |
| ], |
| [[0, 16],]); |
| |
| |
| |
| |
| |
| /** @record */ |
| imageEditor.mojom.ImageEditorHandler_RecordUserAction_Params = class { |
| constructor() { |
| /** @export { !imageEditor.mojom.EditAction } */ |
| this.action; |
| } |
| }; |
| |
| |