Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Embedding api GOOOOOOOooooooooooooooooo #6015

Closed
Closed
Changes from 1 commit
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

load passed url when creating cef_browser

  • Loading branch information
Mike Blumenkrantz
Mike Blumenkrantz committed May 12, 2015
commit cf647bc3039b1653a1ca5cc4f321e17f81835af7
@@ -11,6 +11,7 @@ use interfaces::{cef_request_context_t};
use servo::Browser;
use types::{cef_browser_settings_t, cef_string_t, cef_window_info_t};
use window;
use wrappers::CefWrap;

use compositing::windowing::{WindowNavigateMsg, WindowEvent};
use glutin_app;
@@ -212,11 +213,14 @@ pub fn browser_callback_after_created(browser: CefBrowser) {

fn browser_host_create(window_info: &cef_window_info_t,
client: CefClient,
url: *const cef_string_t,
callback_executed: bool)
-> CefBrowser {
let url = "http://s27.postimg.org/vqbtrolyr/servo.jpg".to_owned();
//let url = "http://s27.postimg.org/vqbtrolyr/servo.jpg".to_owned();
let mut opts = opts::default_opts();
opts.url = url;
unsafe {
opts.url = String::from_utf16(CefWrap::to_rust(url)).unwrap();
}
let browser = ServoCefBrowser::new(window_info, client).as_cef_interface();
browser.init(window_info);
if callback_executed {
@@ -231,27 +235,25 @@ fn browser_host_create(window_info: &cef_window_info_t,
cef_static_method_impls! {
fn cef_browser_host_create_browser(window_info: *const cef_window_info_t,
client: *mut cef_client_t,
_url: *const cef_string_t,
url: *const cef_string_t,
_browser_settings: *const cef_browser_settings_t,
_request_context: *mut cef_request_context_t)
-> c_int {{
let client: CefClient = client;
let _url: &[u16] = _url;
let _browser_settings: &cef_browser_settings_t = _browser_settings;
let _request_context: CefRequestContext = _request_context;
browser_host_create(window_info, client, false);
browser_host_create(window_info, client, url, false);
1i32
}}
fn cef_browser_host_create_browser_sync(window_info: *const cef_window_info_t,
client: *mut cef_client_t,
_url: *const cef_string_t,
url: *const cef_string_t,
_browser_settings: *const cef_browser_settings_t,
_request_context: *mut cef_request_context_t)
-> *mut cef_browser_t {{
let client: CefClient = client;
let _url: &[u16] = _url;
let _browser_settings: &cef_browser_settings_t = _browser_settings;
let _request_context: CefRequestContext = _request_context;
browser_host_create(window_info, client, true)
browser_host_create(window_info, client, url, true)
}}
}
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.