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

Embedder handling of prompts and alerts #20707

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

Always

Just for now

Prev

fix url input for android

  • Loading branch information
gterzian committed May 24, 2018
commit a5dc1b6764beee0e5d6439d4b7e3e73a82215bcd
@@ -99,7 +99,7 @@ impl Browser {
String::from("")
};
let title = "URL or search query";
if let Some(input) = tinyfiledialogs::input_box(title, title, &url) {
if let Some(input) = get_url_input(title, &url) {
if let Some(url) = sanitize_url(&input) {
self.event_queue.push(WindowEvent::LoadUrl(id, url));
}
@@ -351,6 +351,17 @@ fn display_alert_dialog(_message: String) {
// tinyfiledialogs not supported on Android
}

#[cfg(not(any(target_os = "macos", target_os = "linux", target_os = "windows")))]
fn get_url_input(_title: &str, _url: &str) -> Option<String> {
// tinyfiledialogs not supported on Android
None
}

#[cfg(any(target_os = "macos", target_os = "linux", target_os = "windows"))]
fn get_url_input(title: &str, url: &str) -> Option<String> {
tinyfiledialogs::input_box(title, title, url)
}

#[cfg(target_os = "linux")]
fn platform_get_selected_devices(devices: Vec<String>) -> Option<String> {
let picker_name = "Choose a device";
@@ -34,6 +34,7 @@ extern crate servo;
#[cfg(all(feature = "unstable", not(target_os = "android")))]
#[macro_use]
extern crate sig;
#[cfg(any(target_os = "macos", target_os = "linux", target_os = "windows"))]
extern crate tinyfiledialogs;
extern crate winit;
#[cfg(target_os = "windows")] extern crate winapi;
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.