mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
parent
05212b702d
commit
12f20f1ecc
10 changed files with 69 additions and 1 deletions
|
@ -454,6 +454,10 @@ impl<Window: WindowMethods> IOCompositor<Window> {
|
|||
self.composite_if_necessary(CompositingReason::Headless);
|
||||
}
|
||||
|
||||
(Msg::NewFavicon(url), ShutdownState::NotShuttingDown) => {
|
||||
self.window.set_favicon(url);
|
||||
}
|
||||
|
||||
// When we are shutting_down, we need to avoid performing operations
|
||||
// such as Paint that may crash because we have begun tearing down
|
||||
// the rest of our resources.
|
||||
|
|
|
@ -180,6 +180,8 @@ pub enum Msg {
|
|||
ViewportConstrained(PipelineId, ViewportConstraints),
|
||||
/// A reply to the compositor asking if the output image is stable.
|
||||
IsReadyToSaveImageReply(bool),
|
||||
/// A favicon was detected
|
||||
NewFavicon(Url),
|
||||
}
|
||||
|
||||
impl Debug for Msg {
|
||||
|
@ -206,6 +208,7 @@ impl Debug for Msg {
|
|||
Msg::PaintTaskExited(..) => write!(f, "PaintTaskExited"),
|
||||
Msg::ViewportConstrained(..) => write!(f, "ViewportConstrained"),
|
||||
Msg::IsReadyToSaveImageReply(..) => write!(f, "IsReadyToSaveImageReply"),
|
||||
Msg::NewFavicon(..) => write!(f, "NewFavicon"),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -468,6 +468,10 @@ impl<LTF: LayoutTaskFactory, STF: ScriptTaskFactory> Constellation<LTF, STF> {
|
|||
debug!("constellation got remove iframe message");
|
||||
self.handle_remove_iframe_msg(containing_pipeline_id, subpage_id);
|
||||
}
|
||||
ConstellationMsg::NewFavicon(url) => {
|
||||
debug!("constellation got new favicon message");
|
||||
self.compositor_proxy.send(CompositorMsg::NewFavicon(url));
|
||||
}
|
||||
}
|
||||
true
|
||||
}
|
||||
|
|
|
@ -109,6 +109,7 @@ impl CompositorEventListener for NullCompositor {
|
|||
Msg::CreatePng(..) |
|
||||
Msg::PaintTaskExited(..) |
|
||||
Msg::IsReadyToSaveImageReply(..) => {}
|
||||
Msg::NewFavicon(..) => {}
|
||||
}
|
||||
true
|
||||
}
|
||||
|
|
|
@ -138,4 +138,7 @@ pub trait WindowMethods {
|
|||
|
||||
/// Does this window support a clipboard
|
||||
fn supports_clipboard(&self) -> bool;
|
||||
|
||||
/// Add a favicon
|
||||
fn set_favicon(&self, url: Url);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue