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

Side by Side Diff: chrome/browser/page_load_metrics/ads_detection.h

Issue 2946113002: Use FrameIsAd to decide whether to isolate a frame in TopDocumentIsolation mode. (Closed)
Patch Set: Addressing CR feedback from jkarlin@ and creis@. 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_ADS_DETECTION_H_
6 #define CHROME_BROWSER_PAGE_LOAD_METRICS_ADS_DETECTION_H_
7
8 #include <bitset>
9
10 namespace content {
11 class NavigationHandle;
12 } // namespace content
13
14 namespace page_load_metrics {
15
16 // The types of ads that one can detect or filter on.
17 enum AdType {
18 AD_TYPE_GOOGLE = 0,
19 AD_TYPE_SUBRESOURCE_FILTER = 1,
20 AD_TYPE_ALL = 2,
21 AD_TYPE_MAX = AD_TYPE_ALL
22 };
23 using AdTypes = std::bitset<AD_TYPE_MAX>;
24
25 // Uses heuristics to determine if |navigation_handle| is a navigation for an
26 // ad. Must be called no earlier than
27 // NavigationHandleImpl::ReadyToCommitNavigation.
28 const AdTypes& GetDetectedAdTypes(content::NavigationHandle* navigation_handle);
29
30 // Marks the |navigation_handle| as loading an advertisment of a given |type|.
31 void SetDetectedAdType(content::NavigationHandle* navigation_handle,
32 AdType type);
33
34 } // namespace page_load_metrics
35
36 #endif // CHROME_BROWSER_PAGE_LOAD_METRICS_ADS_DETECTION_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698