mirror of
https://github.com/servo/servo.git
synced 2025-08-15 02:15:33 +01:00
Servoshell: Refactor save_output_image and implement into OHOS (#37237)
Split out `save_output_image_if_necessary` into its own file so the code can be shared by servoshell on the desktop and ohos. Additionally, hook it up to the loop in OHOS and have OHOS allow exiting. Testing: Manual testing on ohos and desktop. --------- Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
This commit is contained in:
parent
f60c857fcf
commit
5114e24db1
6 changed files with 75 additions and 31 deletions
|
@ -8,6 +8,7 @@ interface ServoXComponentInterface {
|
|||
goBack(): void;
|
||||
goForward(): void;
|
||||
registerURLcallback(callback: (url: string) => void): void;
|
||||
registerTerminateCallback(callback: () => void): void;
|
||||
registerPromptToastCallback(callback: (msg: string) => void): void
|
||||
initServo(options: InitOpts): void;
|
||||
}
|
||||
|
@ -130,6 +131,7 @@ struct Index {
|
|||
console.info('New URL from native: ', new_url)
|
||||
this.urlToLoad = new_url
|
||||
})
|
||||
this.xComponentContext.registerTerminateCallback(() => { this.context?.terminateSelf(); })
|
||||
this.xComponentContext.registerPromptToastCallback(prompt_toast)
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue