Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef COMPONENTS_PAYMENTS_ANDROID_PAYMENT_MANIFEST_WEB_DATA_SERVICE_H_ | |
| 6 | |
|
please use gerrit instead
2017/04/24 18:22:32
#define COMPONENTS_PAYMENTS_ANDROID_PAYMENT_MANIFE
gogerald1
2017/04/26 13:46:33
Done.
| |
| 7 #include "base/memory/ref_counted.h" | |
| 8 #include "components/payments/android/payment_method_manifest_table.h" | |
| 9 #include "components/payments/android/web_app_manifest_section_table.h" | |
| 10 #include "components/webdata/common/web_data_results.h" | |
| 11 #include "components/webdata/common/web_data_service_base.h" | |
| 12 #include "components/webdata/common/web_data_service_consumer.h" | |
| 13 #include "components/webdata/common/web_database_service.h" | |
| 14 | |
| 15 namespace payments { | |
| 16 | |
| 17 // Web data service to read/write data in WebAppManifestSectionTable and | |
| 18 // PaymentMethodManifestTable. | |
| 19 class PaymentManifestWebDataService : public WebDataServiceBase { | |
| 20 public: | |
| 21 PaymentManifestWebDataService( | |
| 22 scoped_refptr<WebDatabaseService> wdbs, | |
| 23 const ProfileErrorCallback& callback, | |
| 24 const scoped_refptr<base::SingleThreadTaskRunner>& ui_thread); | |
| 25 | |
| 26 // Adds the web app |manifest|. | |
| 27 void AddPaymentWebAppManifest( | |
| 28 const std::vector<mojom::WebAppManifestSectionPtr>& manifest); | |
| 29 | |
| 30 // Gets the |web_app|'s manifest. | |
| 31 WebDataServiceBase::Handle GetPaymentWebAppManifest( | |
| 32 const std::string& web_app, | |
| 33 WebDataServiceConsumer* consumer); | |
| 34 | |
| 35 // Adds the |payment_method|'s manifest. | |
| 36 void AddPaymentMethodManifest(const std::string& payment_method, | |
| 37 const std::vector<std::string>& web_app_ids); | |
|
please use gerrit instead
2017/04/24 18:22:32
s/web_app_id/android_app_package_name/g (or simply
gogerald1
2017/04/26 13:46:33
Done.
| |
| 38 | |
| 39 // Gets the |payment_method|'s manifest. | |
| 40 WebDataServiceBase::Handle GetPaymentMethodManifest( | |
| 41 const std::string& payment_method, | |
| 42 WebDataServiceConsumer* consumer); | |
| 43 | |
| 44 protected: | |
| 45 ~PaymentManifestWebDataService() override; | |
|
please use gerrit instead
2017/04/24 18:22:32
Why is this protected?
gogerald1
2017/04/26 13:46:33
Not allowed to be destructed from outside of this
please use gerrit instead
2017/04/26 15:00:43
I don't see Destroy() anywhere in payment_manifest
gogerald1
2017/04/26 17:30:30
Ah, sorry, I thought this is payment_manifest_web_
| |
| 46 | |
| 47 private: | |
| 48 WebDatabase::State AddPaymentWebAppManifestImpl( | |
| 49 const std::vector<mojom::WebAppManifestSectionPtr>& manifest, | |
| 50 WebDatabase* db); | |
| 51 WebDatabase::State AddPaymentMethodManifestImpl( | |
| 52 const std::string& payment_method, | |
| 53 const std::vector<std::string>& web_app_ids, | |
| 54 WebDatabase* db); | |
| 55 | |
| 56 std::unique_ptr<WDTypedResult> GetPaymentWebAppManifestImpl( | |
| 57 const std::string& web_app, | |
| 58 WebDatabase* db); | |
| 59 std::unique_ptr<WDTypedResult> GetPaymentMethodManifestImpl( | |
| 60 const std::string& payment_method, | |
| 61 WebDatabase* db); | |
| 62 | |
| 63 DISALLOW_COPY_AND_ASSIGN(PaymentManifestWebDataService); | |
| 64 }; | |
| 65 | |
| 66 } // namespace payments | |
| 67 | |
| 68 #endif // COMPONENTS_PAYMENTS_ANDROID_PAYMENT_MANIFEST_WEB_DATA_SERVICE_H_ | |
| OLD | NEW |