Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(785)

Unified Diff: content/browser/payments/payment_app_database.h

Issue 2873683002: PaymentHandler: Implement GetAllPaymentApps(). (Closed)
Patch Set: installed -> stored in public Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/browser/payments/payment_app.proto ('k') | content/browser/payments/payment_app_database.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/payments/payment_app_database.h
diff --git a/content/browser/payments/payment_app_database.h b/content/browser/payments/payment_app_database.h
index 06c22d9191306995805688333ada7e6293cee988..36a23315718b834afc76f4adeedb1777bed3e468 100644
--- a/content/browser/payments/payment_app_database.h
+++ b/content/browser/payments/payment_app_database.h
@@ -5,6 +5,7 @@
#ifndef CONTENT_BROWSER_PAYMENTS_PAYMENT_APP_DATABASE_H_
#define CONTENT_BROWSER_PAYMENTS_PAYMENT_APP_DATABASE_H_
+#include <memory>
#include <string>
#include <vector>
@@ -15,6 +16,7 @@
#include "content/browser/service_worker/service_worker_registration.h"
#include "content/common/content_export.h"
#include "content/common/service_worker/service_worker_status_code.h"
+#include "content/public/browser/stored_payment_instrument.h"
#include "mojo/public/cpp/bindings/binding.h"
namespace content {
@@ -32,6 +34,11 @@ class CONTENT_EXPORT PaymentAppDatabase {
std::pair<int64_t, payments::mojom::PaymentAppManifestPtr>;
using Manifests = std::vector<ManifestWithID>;
using ReadAllManifestsCallback = base::OnceCallback<void(Manifests)>;
+
+ using Instruments = std::vector<std::unique_ptr<StoredPaymentInstrument>>;
+ using PaymentApps = std::map<GURL, Instruments>;
+ using ReadAllPaymentAppsCallback = base::OnceCallback<void(PaymentApps)>;
+
using DeletePaymentInstrumentCallback =
base::OnceCallback<void(payments::mojom::PaymentHandlerStatus)>;
using ReadPaymentInstrumentCallback =
@@ -56,6 +63,9 @@ class CONTENT_EXPORT PaymentAppDatabase {
WriteManifestCallback callback);
void ReadManifest(const GURL& scope, ReadManifestCallback callback);
void ReadAllManifests(ReadAllManifestsCallback callback);
+
+ void ReadAllPaymentApps(ReadAllPaymentAppsCallback callback);
+
void DeletePaymentInstrument(const GURL& scope,
const std::string& instrument_key,
DeletePaymentInstrumentCallback callback);
@@ -99,6 +109,12 @@ class CONTENT_EXPORT PaymentAppDatabase {
const std::vector<std::pair<int64_t, std::string>>& raw_data,
ServiceWorkerStatusCode status);
+ // ReadAllPaymentApps callbacks
+ void DidReadAllPaymentApps(
+ ReadAllPaymentAppsCallback callback,
+ const std::vector<std::pair<int64_t, std::string>>& raw_data,
+ ServiceWorkerStatusCode status);
+
// DeletePaymentInstrument callbacks
void DidFindRegistrationToDeletePaymentInstrument(
const std::string& instrument_key,
« no previous file with comments | « content/browser/payments/payment_app.proto ('k') | content/browser/payments/payment_app_database.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698