blob: c31f6599b50181435094471e302ddaaf0f1a768b [file] [log] [blame]
Avi Drissman8ba1bad2022-09-13 19:22:361// Copyright 2020 The Chromium Authors
Evan Stadeaecdf1b52020-12-02 03:01:532// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
Evan Stade2229a562021-01-12 18:30:075#ifndef COMPONENTS_WEBAPPS_BROWSER_ANDROID_WEBAPPS_UTILS_H_
6#define COMPONENTS_WEBAPPS_BROWSER_ANDROID_WEBAPPS_UTILS_H_
Evan Stadeaecdf1b52020-12-02 03:01:537
Alan Cuttere511d18a2021-08-04 23:10:388#include "third_party/blink/public/mojom/manifest/manifest.mojom-forward.h"
Evan Stadeaecdf1b52020-12-02 03:01:539
Alan Cuttere511d18a2021-08-04 23:10:3810class GURL;
Evan Stadecf7586242020-12-17 20:38:4911
Evan Stadeaecdf1b52020-12-02 03:01:5312namespace content {
13class BrowserContext;
14}
15
16namespace webapps {
17
Susanne Westphal8e116dc2022-04-25 09:57:4218enum class WebApkInstallResult;
19
Evan Stadeaecdf1b52020-12-02 03:01:5320class WebappsUtils {
21 public:
22 WebappsUtils() = delete;
23 WebappsUtils& operator=(const WebappsUtils&) = delete;
24 WebappsUtils(const WebappsUtils&) = delete;
25
26 // Returns true if there is an installed WebAPK which can handle |url|.
27 static bool IsWebApkInstalled(content::BrowserContext* browser_context,
28 const GURL& url);
Evan Stadecf7586242020-12-17 20:38:4929
30 // Returns whether the format of the URLs in the Web Manifest is WebAPK
31 // compatible.
32 static bool AreWebManifestUrlsWebApkCompatible(
Alan Cuttere511d18a2021-08-04 23:10:3833 const blink::mojom::Manifest& manifest);
Susanne Westphal8e116dc2022-04-25 09:57:4234
35 // Shows toast notifying user of the result of a WebAPK install if the
36 // installation was not successful.
37 static void ShowWebApkInstallResultToast(webapps::WebApkInstallResult result);
Evan Stadeaecdf1b52020-12-02 03:01:5338};
39
40} // namespace webapps
41
Evan Stade2229a562021-01-12 18:30:0742#endif // COMPONENTS_WEBAPPS_BROWSER_ANDROID_WEBAPPS_UTILS_H_