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

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

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
Index: components/payments/content/can_make_payment_query_factory.cc
diff --git a/components/payments/content/can_make_payment_query_factory.cc b/components/payments/content/can_make_payment_query_factory.cc
new file mode 100644
index 0000000000000000000000000000000000000000..2f8817302dcc81dedee112593d17ba86c7ff473d
--- /dev/null
+++ b/components/payments/content/can_make_payment_query_factory.cc
@@ -0,0 +1,36 @@
+// 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.
+
+#include "components/payments/content/can_make_payment_query_factory.h"
+
+#include "base/memory/singleton.h"
+#include "components/keyed_service/content/browser_context_dependency_manager.h"
+#include "components/payments/core/can_make_payment_query.h"
+
+namespace payments {
+
+// static
+CanMakePaymentQueryFactory* CanMakePaymentQueryFactory::GetInstance() {
+ return base::Singleton<CanMakePaymentQueryFactory>::get();
+}
+
+CanMakePaymentQuery* CanMakePaymentQueryFactory::GetForContext(
+ content::BrowserContext* context) {
+ return static_cast<CanMakePaymentQuery*>(
+ GetInstance()->GetServiceForBrowserContext(context, true));
+}
+
+CanMakePaymentQueryFactory::CanMakePaymentQueryFactory()
+ : BrowserContextKeyedServiceFactory(
+ "CanMakePaymentQuery",
+ BrowserContextDependencyManager::GetInstance()) {}
+
+CanMakePaymentQueryFactory::~CanMakePaymentQueryFactory() {}
+
+KeyedService* CanMakePaymentQueryFactory::BuildServiceInstanceFor(
+ content::BrowserContext* context) const {
+ return new CanMakePaymentQuery;
+}
+
+} // namespace payments
« no previous file with comments | « components/payments/content/can_make_payment_query_factory.h ('k') | components/payments/content/payment_request.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698