Skip to content

Commit

Permalink
add embedding method for load_handler::on_load_error
Browse files Browse the repository at this point in the history
still needs error text messages I guess
  • Loading branch information
Mike Blumenkrantz committed May 27, 2015
1 parent 8e78feb commit 14a6390
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion ports/cef/window.rs
Expand Up @@ -361,7 +361,21 @@ impl WindowMethods for Window {
}
}

fn load_error(&self, _: NetError, _: String) {
fn load_error(&self, code: NetError, url: String) {
let browser = self.cef_browser.borrow();
let browser = match *browser {
None => return,
Some(ref browser) => browser,
};
if check_ptr_exist!(browser.get_host().get_client(), get_load_handler) &&
check_ptr_exist!(browser.get_host().get_client().get_load_handler(), on_load_error) {
let utf16_chars: Vec<u16> = Utf16Encoder::new((url).chars()).collect();
browser.get_host()
.get_client()
.get_load_handler()
.on_load_error((*browser).clone(), browser.get_main_frame(),
code, &[], utf16_chars.as_slice());
}
}

fn set_page_title(&self, string: Option<String>) {
Expand Down

0 comments on commit 14a6390

Please sign in to comment.