aboutsummaryrefslogtreecommitdiffstats
path: root/components/embedder_traits/lib.rs
diff options
context:
space:
mode:
authorbors-servo <servo-ops@mozilla.com>2020-03-30 03:08:08 -0400
committerGitHub <noreply@github.com>2020-03-30 03:08:08 -0400
commitc3ecf2ecef36bfc35ba75442c81d54fd2bc695be (patch)
tree5eba6d658e6dc1cadd9481a3ed180fc124dc9f45 /components/embedder_traits/lib.rs
parentf913dcd7f9fd631e996e00af8b4222c496c093d7 (diff)
parented601bcbad78859bb0d7efad754bfa3ed00ce8f3 (diff)
downloadservo-c3ecf2ecef36bfc35ba75442c81d54fd2bc695be.tar.gz
servo-c3ecf2ecef36bfc35ba75442c81d54fd2bc695be.zip
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.
Diffstat (limited to 'components/embedder_traits/lib.rs')
-rw-r--r--components/embedder_traits/lib.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/components/embedder_traits/lib.rs b/components/embedder_traits/lib.rs
index 45fa6e1d7b4..961cd5e53a4 100644
--- a/components/embedder_traits/lib.rs
+++ b/components/embedder_traits/lib.rs
@@ -107,6 +107,13 @@ impl EmbedderReceiver {
}
#[derive(Deserialize, Serialize)]
+pub enum ContextMenuResult {
+ Dismissed,
+ Ignored,
+ Selected(usize),
+}
+
+#[derive(Deserialize, Serialize)]
pub enum PromptDefinition {
/// Show a message.
Alert(String, IpcSender<()>),
@@ -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"),
}
}
}