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

Unified Diff: ios/chrome/browser/payments/ios_can_make_payment_query_factory.h

Issue 2968503002: [Payment Request] CanMakePayment (Closed)
Patch Set: Created 3 years, 6 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: ios/chrome/browser/payments/ios_can_make_payment_query_factory.h
diff --git a/ios/chrome/browser/payments/ios_can_make_payment_query_factory.h b/ios/chrome/browser/payments/ios_can_make_payment_query_factory.h
new file mode 100644
index 0000000000000000000000000000000000000000..e3549e3817d6b5abe6ac0d181daae08ceb7452ab
--- /dev/null
+++ b/ios/chrome/browser/payments/ios_can_make_payment_query_factory.h
@@ -0,0 +1,47 @@
+// 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 IOS_CHROME_BROWSER_PAYMENTS_IOS_CAN_MAKE_PAYMENT_QUERY_FACTORY_H_
+#define IOS_CHROME_BROWSER_PAYMENTS_IOS_CAN_MAKE_PAYMENT_QUERY_FACTORY_H_
+
+#include <memory>
+
+#include "base/macros.h"
+#include "components/keyed_service/ios/browser_state_keyed_service_factory.h"
+
+namespace base {
+template <typename T>
+struct DefaultSingletonTraits;
+} // namespace base
+
+namespace ios {
+class ChromeBrowserState;
+} // namespace ios
+
+namespace payments {
+class CanMakePaymentQuery;
+} // namespace payments
+
+// Ensures that there's only one instance of CanMakePaymentQuery per browser
+// state.
+class IOSCanMakePaymentQueryFactory : public BrowserStateKeyedServiceFactory {
+ public:
+ static IOSCanMakePaymentQueryFactory* GetInstance();
+ payments::CanMakePaymentQuery* GetForBrowserState(
+ ios::ChromeBrowserState* browser_state);
+
+ private:
+ friend struct base::DefaultSingletonTraits<IOSCanMakePaymentQueryFactory>;
+
+ IOSCanMakePaymentQueryFactory();
+ ~IOSCanMakePaymentQueryFactory() override;
+
+ // BrowserStateKeyedServiceFactory implementation.
+ std::unique_ptr<KeyedService> BuildServiceInstanceFor(
+ web::BrowserState* context) const override;
+
+ DISALLOW_COPY_AND_ASSIGN(IOSCanMakePaymentQueryFactory);
+};
+
+#endif // IOS_CHROME_BROWSER_PAYMENTS_IOS_CAN_MAKE_PAYMENT_QUERY_FACTORY_H_
« no previous file with comments | « ios/chrome/browser/payments/BUILD.gn ('k') | ios/chrome/browser/payments/ios_can_make_payment_query_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698