Notify embedder when history changes

This commit is contained in:
Paul Rouget 2017-04-07 06:27:30 +02:00
parent 485a4de729
commit e493548135
6 changed files with 111 additions and 77 deletions

View file

@ -494,10 +494,6 @@ impl<Window: WindowMethods> IOCompositor<Window> {
self.change_page_title(pipeline_id, title);
}
(Msg::ChangePageUrl(pipeline_id, url), ShutdownState::NotShuttingDown) => {
self.change_page_url(pipeline_id, url);
}
(Msg::SetFrameTree(frame_tree, response_chan),
ShutdownState::NotShuttingDown) => {
self.set_frame_tree(&frame_tree, response_chan);
@ -532,11 +528,11 @@ impl<Window: WindowMethods> IOCompositor<Window> {
self.window.status(message);
}
(Msg::LoadStart(back, forward), ShutdownState::NotShuttingDown) => {
self.window.load_start(back, forward);
(Msg::LoadStart, ShutdownState::NotShuttingDown) => {
self.window.load_start();
}
(Msg::LoadComplete(back, forward, root), ShutdownState::NotShuttingDown) => {
(Msg::LoadComplete, ShutdownState::NotShuttingDown) => {
self.got_load_complete_message = true;
// If we're painting in headless mode, schedule a recomposite.
@ -547,7 +543,7 @@ impl<Window: WindowMethods> IOCompositor<Window> {
// Inform the embedder that the load has finished.
//
// TODO(pcwalton): Specify which frame's load completed.
self.window.load_end(back, forward, root);
self.window.load_end();
}
(Msg::AllowNavigation(url, response_chan), ShutdownState::NotShuttingDown) => {
@ -625,6 +621,10 @@ impl<Window: WindowMethods> IOCompositor<Window> {
self.window.head_parsed();
}
(Msg::HistoryChanged(entries, current), ShutdownState::NotShuttingDown) => {
self.window.history_changed(entries, current);
}
(Msg::PipelineVisibilityChanged(pipeline_id, visible), ShutdownState::NotShuttingDown) => {
self.pipeline_details(pipeline_id).visible = visible;
if visible {
@ -720,10 +720,6 @@ impl<Window: WindowMethods> IOCompositor<Window> {
}
}
fn change_page_url(&mut self, _: PipelineId, url: ServoUrl) {
self.window.set_page_url(url);
}
fn set_frame_tree(&mut self,
frame_tree: &SendableFrameTree,
response_chan: IpcSender<()>) {
@ -923,7 +919,6 @@ impl<Window: WindowMethods> IOCompositor<Window> {
self.got_load_complete_message = false;
match ServoUrl::parse(&url_string) {
Ok(url) => {
self.window.set_page_url(url.clone());
let msg = match self.root_pipeline {
Some(ref pipeline) => ConstellationMsg::LoadUrl(pipeline.id, LoadData::new(url, None, None)),
None => ConstellationMsg::InitLoadUrl(url)