| // Copyright 2021 The Chromium Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| |
| #ifndef CONTENT_BROWSER_PRERENDER_PRERENDER_METRICS_H_ |
| #define CONTENT_BROWSER_PRERENDER_PRERENDER_METRICS_H_ |
| |
| #include <string> |
| |
| #include "base/time/time.h" |
| #include "content/public/browser/prerender_trigger_type.h" |
| #include "services/metrics/public/cpp/ukm_source_id.h" |
| |
| namespace content { |
| |
| // These values are persisted to logs. Entries should not be renumbered and |
| // numeric values should never be reused. |
| // Note: Please update GetCancelledInterfaceType() in the corresponding .cc file |
| // if you add a new item. |
| enum class PrerenderCancelledInterface { |
| kUnknown = 0, // For kCancel interfaces added by embedders or tests. |
| kGamepadHapticsManager = 1, |
| kGamepadMonitor = 2, |
| kNotificationService = 3, |
| kMaxValue = kNotificationService |
| }; |
| |
| void RecordPrerenderCancelledInterface(const std::string& interface_name); |
| |
| void RecordPrerenderTriggered(ukm::SourceId ukm_id); |
| |
| void RecordPrerenderActivationTime( |
| base::TimeDelta delta, |
| PrerenderTriggerType trigger_type, |
| const std::string& embedder_histogram_suffix); |
| |
| } // namespace content |
| |
| #endif // CONTENT_BROWSER_PRERENDER_PRERENDER_METRICS_H_ |