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_WEB_APP_MANIFEST_SECTION_TABLE_H_ |
| 6 #define COMPONENTS_PAYMENTS_ANDROID_WEB_APP_MANIFEST_SECTION_TABLE_H_ |
| 7 |
| 8 #include <string> |
| 9 #include <vector> |
| 10 |
| 11 #include "components/payments/content/payment_manifest_parser.mojom.h" |
| 12 #include "components/webdata/common/web_database.h" |
| 13 #include "components/webdata/common/web_database_table.h" |
| 14 |
| 15 namespace payments { |
| 16 |
| 17 // This class manages web_app_manifest_section table in SQLite database. It |
| 18 // expects the following schema. |
| 19 // The interfaces should only be accessed on DB thread. |
| 20 // |
| 21 // web_app_manifest_section The table stores the contents in |
| 22 // WebAppManifestSection. |
| 23 // |
| 24 // id The package name of the app. |
| 25 // min_version Minimum version number of the app. |
| 26 // fingerprints The result of SHA256(signing certificate bytes) for |
| 27 // each certificate in the app. |
| 28 // |
| 29 class WebAppManifestSectionTable : public WebDatabaseTable { |
| 30 public: |
| 31 WebAppManifestSectionTable(); |
| 32 ~WebAppManifestSectionTable() override; |
| 33 |
| 34 // Retrieves the WebAppManifestSectionTable* owned by |db|. |
| 35 static WebAppManifestSectionTable* FromWebDatabase(WebDatabase* db); |
| 36 |
| 37 // WebDatabaseTable: |
| 38 WebDatabaseTable::TypeKey GetTypeKey() const override; |
| 39 bool CreateTablesIfNecessary() override; |
| 40 bool IsSyncable() override; |
| 41 bool MigrateToVersion(int version, bool* update_compatible_version) override; |
| 42 |
| 43 // Adds the web app |*manifest|. Note that the previous web app manifest will |
| 44 // be deleted. |
| 45 bool AddWebAppManifest(mojom::WebAppManifestSection* manifest); |
| 46 |
| 47 // Gets manifest of the |web_app|. Returns nullptr if no manifest exists for |
| 48 // the |web_app|. |
| 49 mojom::WebAppManifestSectionPtr GetWebAppManifest(std::string web_app); |
| 50 |
| 51 private: |
| 52 DISALLOW_COPY_AND_ASSIGN(WebAppManifestSectionTable); |
| 53 }; |
| 54 |
| 55 } // namespace payments |
| 56 |
| 57 #endif // COMPONENTS_PAYMENTS_ANDROID_WEB_APP_MANIFEST_SECTION_TABLE_H_ |
OLD | NEW |