aboutsummaryrefslogtreecommitdiffstats
path: root/components/shared/embedder/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'components/shared/embedder/lib.rs')
-rw-r--r--components/shared/embedder/lib.rs31
1 files changed, 21 insertions, 10 deletions
diff --git a/components/shared/embedder/lib.rs b/components/shared/embedder/lib.rs
index e9427fcc719..575c8f54ff6 100644
--- a/components/shared/embedder/lib.rs
+++ b/components/shared/embedder/lib.rs
@@ -364,16 +364,8 @@ pub enum EmbedderMsg {
ShutdownComplete,
/// Request to display a notification.
ShowNotification(Option<WebViewId>, Notification),
- /// Indicates that the user has activated a `<select>` element.
- ///
- /// The embedder should respond with the new state of the `<select>` element.
- ShowSelectElementMenu(
- WebViewId,
- Vec<SelectElementOptionOrOptgroup>,
- Option<usize>,
- DeviceIntRect,
- IpcSender<Option<usize>>,
- ),
+ /// Request to display a form control to the embedder.
+ ShowFormControl(WebViewId, DeviceIntRect, FormControl),
/// Inform the embedding layer that a JavaScript evaluation has
/// finished with the given result.
FinishJavaScriptEvaluation(
@@ -389,6 +381,18 @@ impl Debug for EmbedderMsg {
}
}
+#[derive(Deserialize, Serialize)]
+pub enum FormControl {
+ /// Indicates that the user has activated a `<select>` element.
+ SelectElement(
+ Vec<SelectElementOptionOrOptgroup>,
+ Option<usize>,
+ IpcSender<Option<usize>>,
+ ),
+ /// Indicates that the user has activated a `<input type=color>` element.
+ ColorPicker(RgbColor, IpcSender<Option<RgbColor>>),
+}
+
/// Filter for file selection;
/// the `String` content is expected to be extension (e.g, "doc", without the prefixing ".")
#[derive(Clone, Debug, Deserialize, Serialize)]
@@ -921,3 +925,10 @@ pub enum JavaScriptEvaluationError {
/// value into a [`JSValue`].
SerializationError,
}
+
+#[derive(Clone, Copy, Debug, Deserialize, Serialize)]
+pub struct RgbColor {
+ pub red: u8,
+ pub green: u8,
+ pub blue: u8,
+}