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

Unified Diff: components/payments/content/can_make_payment_query_factory.h

Issue 2866623003: PaymentRequest.canMakePayment() query quota on desktop. (Closed)
Patch Set: frame 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 | « components/payments/content/DEPS ('k') | components/payments/content/can_make_payment_query_factory.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/payments/content/can_make_payment_query_factory.h
diff --git a/components/payments/content/can_make_payment_query_factory.h b/components/payments/content/can_make_payment_query_factory.h
new file mode 100644
index 0000000000000000000000000000000000000000..3d67e036899c05a04df2e3def700b55f624025b6
--- /dev/null
+++ b/components/payments/content/can_make_payment_query_factory.h
@@ -0,0 +1,46 @@
+// Copyright 2017 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.
+
+#ifndef COMPONENTS_PAYMENTS_CONTENT_CAN_MAKE_PAYMENT_QUERY_FACTORY_H_
+#define COMPONENTS_PAYMENTS_CONTENT_CAN_MAKE_PAYMENT_QUERY_FACTORY_H_
+
+#include "base/macros.h"
+#include "components/keyed_service/content/browser_context_keyed_service_factory.h"
+
+namespace base {
+template <typename T>
+struct DefaultSingletonTraits;
+}
+
+namespace content {
+class BrowserContext;
+}
+
+namespace payments {
+
+class CanMakePaymentQuery;
+
+// Ensures that there's only one instance of CanMakePaymentQuery per browser
+// context.
+class CanMakePaymentQueryFactory : public BrowserContextKeyedServiceFactory {
+ public:
+ static CanMakePaymentQueryFactory* GetInstance();
+ CanMakePaymentQuery* GetForContext(content::BrowserContext* context);
+
+ private:
+ friend struct base::DefaultSingletonTraits<CanMakePaymentQueryFactory>;
+
+ CanMakePaymentQueryFactory();
+ ~CanMakePaymentQueryFactory() override;
+
+ // BrowserContextKeyedServiceFactory:
+ KeyedService* BuildServiceInstanceFor(
+ content::BrowserContext* context) const override;
+
+ DISALLOW_COPY_AND_ASSIGN(CanMakePaymentQueryFactory);
+};
+
+} // namespace payments
+
+#endif // COMPONENTS_PAYMENTS_CONTENT_CAN_MAKE_PAYMENT_QUERY_FACTORY_H_
« no previous file with comments | « components/payments/content/DEPS ('k') | components/payments/content/can_make_payment_query_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698