Add mozbrowser events for location + title change.

This commit is contained in:
Glenn Watson 2015-03-24 11:09:58 +10:00
parent da2231a8fa
commit 7163a3c580
6 changed files with 83 additions and 23 deletions

View file

@ -24,6 +24,7 @@ use profile::time::TimeProfilerChan;
use std::sync::mpsc::{Receiver, channel};
use url::Url;
use util::geometry::{PagePx, ViewportPx};
use util::opts;
/// A uniquely-identifiable pipeline of script task, layout task, and paint task.
pub struct Pipeline {
@ -244,4 +245,18 @@ impl Pipeline {
pub fn add_child(&mut self, frame_id: FrameId) {
self.children.push(frame_id);
}
pub fn trigger_mozbrowser_event(&self,
subpage_id: SubpageId,
event_name: String,
event_detail: Option<String>) {
assert!(opts::experimental_enabled());
let ScriptControlChan(ref script_channel) = self.script_chan;
let event = ConstellationControlMsg::MozBrowserEvent(self.id,
subpage_id,
event_name,
event_detail);
script_channel.send(event).unwrap();
}
}