offline_page_feature.h 3.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. // Copyright 2015 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. #ifndef COMPONENTS_OFFLINE_PAGES_CORE_OFFLINE_PAGE_FEATURE_H_
  5. #define COMPONENTS_OFFLINE_PAGES_CORE_OFFLINE_PAGE_FEATURE_H_
  6. #include "base/feature_list.h"
  7. #include "build/build_config.h"
  8. namespace offline_pages {
  9. extern const base::Feature kOfflinePagesCTFeature;
  10. extern const base::Feature kOfflinePagesLivePageSharingFeature;
  11. extern const base::Feature kBackgroundLoaderForDownloadsFeature;
  12. extern const base::Feature kPrefetchingOfflinePagesFeature;
  13. extern const base::Feature kOfflinePagesCTV2Feature;
  14. extern const base::Feature kOfflinePagesDescriptivePendingStatusFeature;
  15. extern const base::Feature kOfflinePagesInDownloadHomeOpenInCctFeature;
  16. extern const base::Feature kOfflinePagesDescriptiveFailStatusFeature;
  17. extern const base::Feature kOfflineIndicatorFeature;
  18. extern const base::Feature kOnTheFlyMhtmlHashComputationFeature;
  19. extern const base::Feature kOfflinePagesNetworkStateLikelyUnknown;
  20. // The parameter name used to find the experiment tag for prefetching offline
  21. // pages.
  22. extern const char kPrefetchingOfflinePagesExperimentsOption[];
  23. // Returns true if offline CT features are enabled. See crbug.com/620421.
  24. bool IsOfflinePagesCTEnabled();
  25. // Returns true if live page sharing of offline page is enabled.
  26. bool IsOfflinePagesLivePageSharingEnabled();
  27. // Returns true if prefetching offline pages is enabled.
  28. bool IsPrefetchingOfflinePagesEnabled();
  29. // Returns true if a command line for test has been set that shortens the
  30. // snapshot delay.
  31. bool ShouldUseTestingSnapshotDelay();
  32. // Returns true if we should record request origin as part of custom tabs V2.
  33. bool IsOfflinePagesCTV2Enabled();
  34. // Returns true if descriptive failed download status texts should be used in
  35. // notifications and Downloads Home.
  36. bool IsOfflinePagesDescriptiveFailStatusEnabled();
  37. // Returns true if descriptive pending download status texts should be used in
  38. // notifications and Downloads Home.
  39. bool IsOfflinePagesDescriptivePendingStatusEnabled();
  40. // Controls whether offline pages opened from the Downloads Home should be
  41. // opened in CCTs instead of new tabs.
  42. bool ShouldOfflinePagesInDownloadHomeOpenInCct();
  43. // Returns an experiment tag provided by the field trial. This experiment tag
  44. // will be included in a custom header in all requests sent to Offline Prefetch
  45. // Server. The server will use this this optional tag to decide how to process
  46. // the request.
  47. std::string GetPrefetchingOfflinePagesExperimentTag();
  48. // Returns true if offline indicator UI is shown when the user is offline.
  49. bool IsOfflineIndicatorFeatureEnabled();
  50. // Returns true if we are saving MHTML files to the target location and
  51. // calculating their content digests in one step.
  52. bool IsOnTheFlyMhtmlHashComputationEnabled();
  53. // Returns true if the network state returned by Android device APIs can't be
  54. // trusted. See https://crbug.com/1120144. In such cases, we want to disable
  55. // offline pages to avoid showing them even when the device is online.
  56. bool IsOfflinePagesNetworkStateLikelyUnknown();
  57. } // namespace offline_pages
  58. #endif // COMPONENTS_OFFLINE_PAGES_CORE_OFFLINE_PAGE_FEATURE_H_