Implement Navigator

This commit is contained in:
Tom Schuster 2013-09-05 19:09:10 -04:00
parent 0e351d9f50
commit e81fed7b58
8 changed files with 496 additions and 1 deletions

View file

@ -7,6 +7,7 @@ use dom::bindings::utils::{WrapperCache, DOMString, null_string};
use dom::bindings::utils::{CacheableWrapper, BindingObject};
use dom::document::AbstractDocument;
use dom::node::{AbstractNode, ScriptView};
use dom::navigator::Navigator;
use layout_interface::ReflowForScriptQuery;
use script_task::{ExitMsg, FireTimerMsg, Page, ScriptChan};
@ -41,6 +42,7 @@ pub struct Window {
compositor: @ScriptListener,
wrapper: WrapperCache,
timer_chan: SharedChan<TimerControlMsg>,
navigator: Option<@mut Navigator>,
}
#[unsafe_destructor]
@ -105,6 +107,13 @@ impl Window {
None
}
pub fn Navigator(&mut self) -> @mut Navigator {
if self.navigator.is_none() {
self.navigator = Some(Navigator::new());
}
self.navigator.unwrap()
}
pub fn Confirm(&self, _message: &DOMString) -> bool {
false
}
@ -189,6 +198,7 @@ impl Window {
}
SharedChan::new(timer_chan)
},
navigator: None,
};
unsafe {