aw_feature_entries.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536
  1. // Copyright 2021 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 ANDROID_WEBVIEW_BROWSER_AW_FEATURE_ENTRIES_H_
  5. #define ANDROID_WEBVIEW_BROWSER_AW_FEATURE_ENTRIES_H_
  6. #include <string>
  7. #include <vector>
  8. #include "base/feature_list.h"
  9. #include "components/flags_ui/feature_entry.h"
  10. namespace android_webview {
  11. namespace aw_feature_entries {
  12. // Registers variations parameter values selected for features in WebView.
  13. // The registered variation parameters are connected to their corresponding
  14. // features in |feature_list|. Returns the (possibly empty) comma separated
  15. // list of additional variation ids to register in the MetricsService.
  16. //
  17. // This is a way for WebView to set feature parameters besides the finch,
  18. // for example, add a switch in Dev UI, then setup feature parameters
  19. // according to the switch.
  20. std::vector<std::string> RegisterEnabledFeatureEntries(
  21. base::FeatureList* feature_list);
  22. // Exposed for testing.
  23. namespace internal {
  24. std::string ToEnabledEntry(const flags_ui::FeatureEntry& entry,
  25. int enabled_variation_index);
  26. } // namespace internal
  27. } // namespace aw_feature_entries
  28. } // namespace android_webview
  29. #endif // ANDROID_WEBVIEW_BROWSER_AW_FEATURE_ENTRIES_H_