[Browser API] implement mozbrowsericonchange event

This commit is contained in:
Paul Rouget 2015-11-12 12:10:22 +01:00
parent 27e104aa1a
commit 5263a4c4c9
8 changed files with 154 additions and 25 deletions

View file

@ -313,7 +313,7 @@ pub enum MozBrowserEvent {
/// Sent when an error occurred while trying to load content within a browser `<iframe>`.
Error,
/// Sent when the favicon of a browser `<iframe>` changes.
IconChange,
IconChange(String, String, String),
/// Sent when the browser `<iframe>` has finished loading all its assets.
LoadEnd,
/// Sent when the browser `<iframe>` starts to load a new page.
@ -341,7 +341,7 @@ impl MozBrowserEvent {
MozBrowserEvent::Close => "mozbrowserclose",
MozBrowserEvent::ContextMenu => "mozbrowsercontextmenu",
MozBrowserEvent::Error => "mozbrowsererror",
MozBrowserEvent::IconChange => "mozbrowsericonchange",
MozBrowserEvent::IconChange(_, _, _) => "mozbrowsericonchange",
MozBrowserEvent::LoadEnd => "mozbrowserloadend",
MozBrowserEvent::LoadStart => "mozbrowserloadstart",
MozBrowserEvent::LocationChange(_) => "mozbrowserlocationchange",
@ -353,17 +353,6 @@ impl MozBrowserEvent {
MozBrowserEvent::OpenSearch => "mozbrowseropensearch"
}
}
pub fn detail(&self) -> Option<String> {
match *self {
MozBrowserEvent::AsyncScroll | MozBrowserEvent::Close | MozBrowserEvent::ContextMenu |
MozBrowserEvent::Error | MozBrowserEvent::IconChange | MozBrowserEvent::LoadEnd |
MozBrowserEvent::LoadStart | MozBrowserEvent::OpenWindow | MozBrowserEvent::SecurityChange |
MozBrowserEvent::ShowModalPrompt | MozBrowserEvent::UsernameAndPasswordRequired |
MozBrowserEvent::OpenSearch => None,
MozBrowserEvent::LocationChange(ref new_location) => Some(new_location.clone()),
MozBrowserEvent::TitleChange(ref new_title) => Some(new_title.clone()),
}
}
}
#[derive(Deserialize, Serialize)]