Skip to content
Permalink
Browse files

add embedding method for load_handler::on_load_error

still needs error text messages I guess
  • Loading branch information
Mike Blumenkrantz
Mike Blumenkrantz committed May 27, 2015
1 parent 8e78feb commit 14a6390f0375323fed8898729feb3479f5462404
Showing with 15 additions and 1 deletion.
  1. +15 −1 ports/cef/window.rs
@@ -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>) {

0 comments on commit 14a6390

Please sign in to comment.
You can’t perform that action at this time.