mirror of
https://github.com/servo/servo.git
synced 2025-08-18 03:45:33 +01:00
Rework “visible” to “throttled” in embedder-to-constellation + jniapi (#31815)
This commit is contained in:
parent
49c6f9e463
commit
0b863de846
7 changed files with 16 additions and 16 deletions
|
@ -601,10 +601,10 @@ impl ServoGlue {
|
|||
self.process_event(EmbedderEvent::MediaSessionAction(action))
|
||||
}
|
||||
|
||||
pub fn change_visibility(&mut self, visible: bool) -> Result<(), &'static str> {
|
||||
info!("change_visibility");
|
||||
pub fn set_throttled(&mut self, throttled: bool) -> Result<(), &'static str> {
|
||||
info!("set_throttled");
|
||||
if let Ok(id) = self.get_browser_id() {
|
||||
let event = EmbedderEvent::WebViewVisibilityChanged(id, visible);
|
||||
let event = EmbedderEvent::SetWebViewThrottled(id, throttled);
|
||||
self.process_event(event)
|
||||
} else {
|
||||
// Ignore visibility change if no browser has been created yet.
|
||||
|
|
|
@ -218,7 +218,7 @@ mod to_servo {
|
|||
Self::ClearCache => target!("ClearCache"),
|
||||
Self::ToggleSamplingProfiler(_, _) => target!("ToggleSamplingProfiler"),
|
||||
Self::MediaSessionAction(_) => target!("MediaSessionAction"),
|
||||
Self::WebViewVisibilityChanged(_, _) => target!("WebViewVisibilityChanged"),
|
||||
Self::SetWebViewThrottled(_, _) => target!("SetWebViewThrottled"),
|
||||
Self::IMEDismissed => target!("IMEDismissed"),
|
||||
Self::InvalidateNativeSurface => target!("InvalidateNativeSurface"),
|
||||
Self::ReplaceNativeSurface(_, _) => target!("ReplaceNativeSurface"),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue