lookalike_url_ui_util.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637
  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. #ifndef COMPONENTS_LOOKALIKES_CORE_LOOKALIKE_URL_UI_UTIL_H_
  5. #define COMPONENTS_LOOKALIKES_CORE_LOOKALIKE_URL_UI_UTIL_H_
  6. #include "components/lookalikes/core/lookalike_url_util.h"
  7. #include "services/metrics/public/cpp/ukm_source_id.h"
  8. namespace base {
  9. class Value;
  10. } // namespace base
  11. // Allow easier reporting of UKM when no interstitial is shown.
  12. void RecordUkmForLookalikeUrlBlockingPage(
  13. ukm::SourceId source_id,
  14. LookalikeUrlMatchType match_type,
  15. LookalikeUrlBlockingPageUserAction user_action,
  16. bool triggered_by_initial_url);
  17. // Record UKM if not already reported for this page.
  18. void ReportUkmForLookalikeUrlBlockingPageIfNeeded(
  19. ukm::SourceId& source_id,
  20. LookalikeUrlMatchType match_type,
  21. LookalikeUrlBlockingPageUserAction action,
  22. bool triggered_by_initial_url);
  23. // Populates |load_time_data| for interstitial HTML.
  24. void PopulateLookalikeUrlBlockingPageStrings(base::Value::Dict& load_time_data,
  25. const GURL& safe_url,
  26. const GURL& request_url);
  27. // Values added to get shared interstitial HTML to play nice.
  28. void PopulateStringsForSharedHTML(base::Value::Dict& load_time_data);
  29. #endif // COMPONENTS_LOOKALIKES_CORE_LOOKALIKE_URL_UI_UTIL_H_