mirror of
https://github.com/servo/servo.git
synced 2025-07-16 03:43:38 +01:00
implement on_address_change handler for cef port
This commit is contained in:
parent
92d44fb36e
commit
02606fada4
1 changed files with 8 additions and 3 deletions
|
@ -367,10 +367,15 @@ impl WindowMethods for Window {
|
|||
Some(ref browser) => browser,
|
||||
};
|
||||
let frame = browser.get_main_frame();
|
||||
let frame = frame.downcast();
|
||||
let servoframe = frame.downcast();
|
||||
// FIXME(https://github.com/rust-lang/rust/issues/23338)
|
||||
let mut frame_url = frame.url.borrow_mut();
|
||||
*frame_url = url.to_string()
|
||||
let mut frame_url = servoframe.url.borrow_mut();
|
||||
*frame_url = url.to_string();
|
||||
let utf16_chars: Vec<u16> = Utf16Encoder::new((*frame_url).chars()).collect();
|
||||
if check_ptr_exist!(browser.get_host().get_client(), get_display_handler) &&
|
||||
check_ptr_exist!(browser.get_host().get_client().get_display_handler(), on_address_change) {
|
||||
browser.get_host().get_client().get_display_handler().on_address_change((*browser).clone(), frame.clone(), utf16_chars.as_slice());
|
||||
}
|
||||
}
|
||||
|
||||
fn handle_key(&self, _: Key, _: KeyModifiers) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue