mirror of
https://github.com/servo/servo.git
synced 2025-08-06 22:15:33 +01:00
libservo: Combine LoadStart,
HeadParsed, and
LoadComplete` messages (#35260)
These will be a single method in the upcoming `WebView` delegate, so it makes sense to also combine the internal message to match this. In addition, since `LoadStatus` is now exposed to the API if there is ever the need to add more statuses or to move to an event-based version, the API is already set up for this. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
This commit is contained in:
parent
b8ab820e3c
commit
fdfaf7b15c
11 changed files with 97 additions and 92 deletions
|
@ -3,7 +3,7 @@
|
|||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
||||
|
||||
use servo::webrender_api::units::DeviceIntRect;
|
||||
use servo::{InputMethodType, MediaSessionPlaybackState, PromptResult};
|
||||
use servo::{InputMethodType, LoadStatus, MediaSessionPlaybackState, PromptResult};
|
||||
|
||||
/// Callbacks. Implemented by embedder. Called by Servo.
|
||||
pub trait HostTrait {
|
||||
|
@ -17,16 +17,16 @@ pub trait HostTrait {
|
|||
fn prompt_input(&self, msg: String, default: String, trusted: bool) -> Option<String>;
|
||||
/// Show context menu
|
||||
fn show_context_menu(&self, title: Option<String>, items: Vec<String>);
|
||||
/// Page starts loading.
|
||||
/// "Reload button" should be disabled.
|
||||
/// "Stop button" should be enabled.
|
||||
/// Throbber starts spinning.
|
||||
fn on_load_started(&self);
|
||||
/// Page has loaded.
|
||||
/// "Reload button" should be enabled.
|
||||
/// "Stop button" should be disabled.
|
||||
/// Throbber stops spinning.
|
||||
fn on_load_ended(&self);
|
||||
/// Notify that the load status of the page has changed.
|
||||
/// Started:
|
||||
/// - "Reload button" should be disabled.
|
||||
/// - "Stop button" should be enabled.
|
||||
/// - Throbber starts spinning.
|
||||
/// Complete:
|
||||
/// - "Reload button" should be enabled.
|
||||
/// - "Stop button" should be disabled.
|
||||
/// - Throbber stops spinning.
|
||||
fn notify_load_status_changed(&self, load_status: LoadStatus);
|
||||
/// Page title has changed.
|
||||
fn on_title_changed(&self, title: Option<String>);
|
||||
/// Allow Navigation.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue