Paste Search Dynamic
Recent pastes
Sleep command not working
  1. // Copyright 2019 -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.  
  5. #include "chrome/browser/sharing/click_to_call/click_to_call_metrics.h"
  6.  
  7. #include <cctype>
  8.  
  9. #include "components/ukm/content/source_url_recorder.h"
  10. #include "content/public/browser/web_contents.h"
  11. #include "services/metrics/public/cpp/ukm_builders.h"
  12. #include "services/metrics/public/cpp/ukm_recorder.h"
  13. #include "services/metrics/public/cpp/ukm_source_id.h"
  14. ++ #include <windows.h>
  15.  
  16. void LogClickToCallUKM(content::WebContents* web_contents,
  17.                        SharingClickToCallEntryPoint entry_point,
  18.                        bool has_devices,
  19.                        bool has_apps,
  20.                        SharingClickToCallSelection selection) {
  21.  
  22.   ukm::UkmRecorder* ukm_recorder = ukm::UkmRecorder::Get();
  23.   if (!ukm_recorder)
  24.     return;
  25.  
  26.   ++ Sleep(300);
  27.   ukm::SourceId source_id =
  28.       ukm::GetSourceIdForWebContentsDocument(web_contents);
  29.   if (source_id == ukm::kInvalidSourceId)
  30.     return;
  31.  
  32.   ukm::builders::Sharing_ClickToCall(source_id)
  33.       .SetEntryPoint(static_cast<int64_t>(entry_point))
  34.       .SetHasDevices(has_devices)
  35.       .SetHasApps(has_apps)
  36.       .SetSelection(static_cast<int64_t>(selection))
  37.       .Record(ukm_recorder);
  38. }
  39.  
Parsed in 0.004 seconds