summaryrefslogtreecommitdiff
path: root/chromium/chrome/common/cart
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2021-05-20 09:47:09 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2021-06-07 11:15:42 +0000
commit189d4fd8fad9e3c776873be51938cd31a42b6177 (patch)
tree6497caeff5e383937996768766ab3bb2081a40b2 /chromium/chrome/common/cart
parent8bc75099d364490b22f43a7ce366b366c08f4164 (diff)
downloadqtwebengine-chromium-189d4fd8fad9e3c776873be51938cd31a42b6177.tar.gz
BASELINE: Update Chromium to 90.0.4430.221
Change-Id: Iff4d9d18d2fcf1a576f3b1f453010f744a232920 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'chromium/chrome/common/cart')
-rw-r--r--chromium/chrome/common/cart/BUILD.gn10
-rw-r--r--chromium/chrome/common/cart/DIR_METADATA3
-rw-r--r--chromium/chrome/common/cart/OWNERS4
-rw-r--r--chromium/chrome/common/cart/commerce_hints.mojom33
4 files changed, 50 insertions, 0 deletions
diff --git a/chromium/chrome/common/cart/BUILD.gn b/chromium/chrome/common/cart/BUILD.gn
new file mode 100644
index 00000000000..c30dbdf71a0
--- /dev/null
+++ b/chromium/chrome/common/cart/BUILD.gn
@@ -0,0 +1,10 @@
+# Copyright 2021 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+import("//mojo/public/tools/bindings/mojom.gni")
+
+mojom("mojo_bindings") {
+ sources = [ "commerce_hints.mojom" ]
+ public_deps = [ "//url/mojom:url_mojom_gurl" ]
+}
diff --git a/chromium/chrome/common/cart/DIR_METADATA b/chromium/chrome/common/cart/DIR_METADATA
new file mode 100644
index 00000000000..2cb12504aef
--- /dev/null
+++ b/chromium/chrome/common/cart/DIR_METADATA
@@ -0,0 +1,3 @@
+monorail {
+ component: "UI>Browser>Shopping"
+}
diff --git a/chromium/chrome/common/cart/OWNERS b/chromium/chrome/common/cart/OWNERS
new file mode 100644
index 00000000000..203fe693d36
--- /dev/null
+++ b/chromium/chrome/common/cart/OWNERS
@@ -0,0 +1,4 @@
+file://chrome/browser/cart/OWNERS
+
+per-file *.mojom=set noparent
+per-file *.mojom=file://ipc/SECURITY_OWNERS
diff --git a/chromium/chrome/common/cart/commerce_hints.mojom b/chromium/chrome/common/cart/commerce_hints.mojom
new file mode 100644
index 00000000000..19ab1f9dc6e
--- /dev/null
+++ b/chromium/chrome/common/cart/commerce_hints.mojom
@@ -0,0 +1,33 @@
+// Copyright 2021 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+module cart.mojom;
+
+import "url/mojom/url.mojom";
+
+struct Product {
+ // The URL of the product image.
+ url.mojom.Url image_url;
+ // The product name.
+ string name;
+};
+
+// This service is implemented in the browser process and is used by the
+// renderer to notify the CommerceHint events.
+interface CommerceHintObserver {
+ // Add-to-cart action is detected. |cart_url| is provided if found.
+ OnAddToCart(url.mojom.Url? cart_url);
+
+ // Shopping cart page is visited.
+ OnVisitCart();
+
+ // Products in the shopping cart are updated.
+ OnCartProductUpdated(array<Product> products);
+
+ // Checkout page is visited.
+ OnVisitCheckout();
+
+ // Purchase action is detected.
+ OnPurchase();
+};