| // Copyright 2018 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 CHROME_BROWSER_WEB_APPLICATIONS_COMPONENTS_WEB_APP_UTILS_H_ |
| #define CHROME_BROWSER_WEB_APPLICATIONS_COMPONENTS_WEB_APP_UTILS_H_ |
| |
| class Profile; |
| |
| namespace base { |
| class FilePath; |
| } |
| |
| namespace content { |
| class BrowserContext; |
| } |
| |
| namespace web_app { |
| |
| // These functions return true if the WebApp System or its subset is allowed |
| // for a given profile. |
| // |profile| can be original profile or its secondary off-the-record profile. |
| // Returns false if |profile| is nullptr. |
| // |
| // Is main WebApp System allowed (WebAppProvider exists): |
| bool AreWebAppsEnabled(Profile* profile); |
| // Is user allowed to install web apps from UI: |
| bool AreWebAppsUserInstallable(Profile* profile); |
| |
| // Get BrowserContext to use for a WebApp KeyedService creation. |
| content::BrowserContext* GetBrowserContextForWebApps( |
| content::BrowserContext* context); |
| content::BrowserContext* GetBrowserContextForWebAppMetrics( |
| content::BrowserContext* context); |
| |
| base::FilePath GetWebAppsDirectory(Profile* profile); |
| |
| } // namespace web_app |
| |
| #endif // CHROME_BROWSER_WEB_APPLICATIONS_COMPONENTS_WEB_APP_UTILS_H_ |