Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(59)

Side by Side Diff: chrome/browser/page_load_metrics/observers/previews_ukm_observer.h

Issue 2952343004: Adding previews information to PLM UKM (Closed)
Patch Set: comment on BroadcastEventToObservers Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2017 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 #ifndef CHROME_BROWSER_PAGE_LOAD_METRICS_OBSERVERS_PREVIEWS_UKM_OBSERVER_H_
6 #define CHROME_BROWSER_PAGE_LOAD_METRICS_OBSERVERS_PREVIEWS_UKM_OBSERVER_H_
7
8 #include "base/macros.h"
9 #include "chrome/browser/page_load_metrics/page_load_metrics_observer.h"
10
11 namespace content {
12 class NavigationHandle;
13 }
14
15 namespace previews {
16
17 // Observer responsible for appending previews information to the PLM UKM
18 // report.
19 class PreviewsUKMObserver : public page_load_metrics::PageLoadMetricsObserver {
20 public:
21 PreviewsUKMObserver();
22 ~PreviewsUKMObserver() override;
23
24 // page_load_metrics::PageLoadMetricsObserver:
25 ObservePolicy OnStart(content::NavigationHandle* navigation_handle,
26 const GURL& currently_committed_url,
27 bool started_in_foreground) override;
28 ObservePolicy OnCommit(content::NavigationHandle* navigation_handle,
29 ukm::SourceId source_id) override;
30 ObservePolicy FlushMetricsOnAppEnterBackground(
31 const page_load_metrics::mojom::PageLoadTiming& timing,
32 const page_load_metrics::PageLoadExtraInfo& info) override;
33 void OnComplete(const page_load_metrics::mojom::PageLoadTiming& timing,
34 const page_load_metrics::PageLoadExtraInfo& info) override;
35 void OnLoadedResource(const page_load_metrics::ExtraRequestCompleteInfo&
36 extra_request_complete_info) override;
37 void OnEventOccurred(const void* const event_key) override;
38
39 private:
40 void RecordPreviewsTypes(const page_load_metrics::PageLoadExtraInfo& info);
41
42 bool server_lofi_seen_ = false;
43 bool client_lofi_seen_ = false;
44 bool lite_page_seen_ = false;
45 bool opt_out_occurred_ = false;
46
47 DISALLOW_COPY_AND_ASSIGN(PreviewsUKMObserver);
48 };
49
50 } // namespace previews
51
52 #endif // CHROME_BROWSER_PAGE_LOAD_METRICS_OBSERVERS_PREVIEWS_UKM_OBSERVER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698