mirror of
https://github.com/servo/servo.git
synced 2025-07-31 19:20:22 +01:00
Context Menu: API
This commit is contained in:
parent
ecdbea518f
commit
ed46f5985c
6 changed files with 86 additions and 3 deletions
|
@ -106,6 +106,13 @@ impl EmbedderReceiver {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Deserialize, Serialize)]
|
||||
pub enum ContextMenuResult {
|
||||
Dismissed,
|
||||
Ignored,
|
||||
Selected(usize),
|
||||
}
|
||||
|
||||
#[derive(Deserialize, Serialize)]
|
||||
pub enum PromptDefinition {
|
||||
/// Show a message.
|
||||
|
@ -149,6 +156,8 @@ pub enum EmbedderMsg {
|
|||
ResizeTo(DeviceIntSize),
|
||||
/// Show dialog to user
|
||||
Prompt(PromptDefinition, PromptOrigin),
|
||||
/// Show a context menu to the user
|
||||
ShowContextMenu(IpcSender<ContextMenuResult>, Vec<String>),
|
||||
/// Whether or not to allow a pipeline to load a url.
|
||||
AllowNavigationRequest(PipelineId, ServoUrl),
|
||||
/// Whether or not to allow script to open a new tab/browser
|
||||
|
@ -235,6 +244,7 @@ impl Debug for EmbedderMsg {
|
|||
EmbedderMsg::ReportProfile(..) => write!(f, "ReportProfile"),
|
||||
EmbedderMsg::MediaSessionEvent(..) => write!(f, "MediaSessionEvent"),
|
||||
EmbedderMsg::OnDevtoolsStarted(..) => write!(f, "OnDevtoolsStarted"),
|
||||
EmbedderMsg::ShowContextMenu(..) => write!(f, "ShowContextMenu"),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue