dom_distiller_features.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  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_DOM_DISTILLER_CORE_DOM_DISTILLER_FEATURES_H_
  5. #define COMPONENTS_DOM_DISTILLER_CORE_DOM_DISTILLER_FEATURES_H_
  6. #include "base/feature_list.h"
  7. class PrefService;
  8. namespace user_prefs {
  9. class PrefRegistrySyncable;
  10. }
  11. namespace dom_distiller {
  12. extern const base::Feature kReaderMode;
  13. void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry);
  14. // Returns true when flag enable-dom-distiller is set or reader mode is enabled
  15. // from flags or Finch.
  16. bool IsDomDistillerEnabled();
  17. // Returns true when reader mode flag is enabled and the flag parameter to add
  18. // "offer reader mode" in chrome://settings is set.
  19. bool OfferReaderModeInSettings();
  20. // Returns true if a user should be shown the option to view pages in reader
  21. // mode, when available. This happens when either:
  22. // A. OfferReaderModeInSettings is true and kOfferReaderMode pref is enabled,
  23. // B. or OfferReaderModeInSettings is false, but IsDomDistillerEnabled is true.
  24. bool ShowReaderModeOption(PrefService* pref_service);
  25. bool ShouldStartDistillabilityService();
  26. } // namespace dom_distiller
  27. #endif // COMPONENTS_DOM_DISTILLER_CORE_DOM_DISTILLER_FEATURES_H_