features.cc 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. // Copyright 2020 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. #include "components/webapps/browser/features.h"
  5. #include "base/feature_list.h"
  6. namespace webapps {
  7. namespace features {
  8. #if BUILDFLAG(IS_ANDROID)
  9. const base::Feature kAddToHomescreenMessaging{
  10. "AddToHomescreenMessaging", base::FEATURE_DISABLED_BY_DEFAULT};
  11. // Enables or disables the installable ambient badge infobar.
  12. const base::Feature kInstallableAmbientBadgeInfoBar{
  13. "InstallableAmbientBadgeInfoBar", base::FEATURE_ENABLED_BY_DEFAULT};
  14. // Enables or disables the installable ambient badge message.
  15. const base::Feature kInstallableAmbientBadgeMessage{
  16. "InstallableAmbientBadgeMessage", base::FEATURE_DISABLED_BY_DEFAULT};
  17. // The capacity of cached domains which do not show message again if
  18. // users do not accept the message.
  19. extern const base::FeatureParam<int>
  20. kInstallableAmbientBadgeMessage_ThrottleDomainsCapacity{
  21. &kInstallableAmbientBadgeMessage,
  22. "installable_ambient_badge_message_throttle_domains_capacity", 100};
  23. // Enables PWA Unique IDs for WebAPKs.
  24. const base::Feature kWebApkUniqueId{"WebApkUniqueId",
  25. base::FEATURE_DISABLED_BY_DEFAULT};
  26. #endif // BUILDFLAG(IS_ANDROID)
  27. // When the user clicks "Create Shortcut" in the dot menu, the current page is
  28. // used as start-url, instead of the manifest-supplied value.
  29. // This allows subpages of web apps to be bookmarked via shortcuts
  30. // separately from their parent app.
  31. // For installing the parent app, the existing "Install Site" should be used
  32. // instead. With this feature, "Install Site" now also shows up for websites
  33. // without service worker, as long as they have a manifest.
  34. const base::Feature kCreateShortcutIgnoresManifest{
  35. "CreateShortcutIgnoresManifest", base::FEATURE_DISABLED_BY_DEFAULT};
  36. // Skip the service worker in all install criteria check. This affect both
  37. // "intallable" and "promotable" status of a web app.
  38. const base::Feature kSkipServiceWorkerCheckAll{
  39. "SkipServiceWorkerCheckAll", base::FEATURE_DISABLED_BY_DEFAULT};
  40. // Skip the service worker install criteria check for installing. This affect
  41. // only the "installable" status but not "promotable".
  42. const base::Feature kSkipServiceWorkerCheckInstallOnly{
  43. "SkipServiceWorkerCheckInstallOnly", base::FEATURE_DISABLED_BY_DEFAULT};
  44. // Enables showing a detailed install dialog for user installs.
  45. const base::Feature kDesktopPWAsDetailedInstallDialog{
  46. "DesktopPWAsDetailedInstallDialog", base::FEATURE_DISABLED_BY_DEFAULT};
  47. bool SkipBannerServiceWorkerCheck() {
  48. return base::FeatureList::IsEnabled(kSkipServiceWorkerCheckAll);
  49. }
  50. bool SkipInstallServiceWorkerCheck() {
  51. return base::FeatureList::IsEnabled(kSkipServiceWorkerCheckAll) ||
  52. base::FeatureList::IsEnabled(kSkipServiceWorkerCheckInstallOnly);
  53. }
  54. } // namespace features
  55. } // namespace webapps