mirror of
https://github.com/servo/servo.git
synced 2025-06-23 16:44:33 +01:00
Auto merge of #26043 - paulrouget:IMMenu, r=jdm
Context menu API This adds an API for Servo internals to request a context menu to the embedder, along an implement for the UWP port.
This commit is contained in:
commit
c3ecf2ecef
10 changed files with 132 additions and 10 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