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

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 csharrison@ (and also small self-review tweaks.) 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 // The types of ads that one can detect or filter on.
15 enum AdType {
16 AD_TYPE_GOOGLE = 0,
17 AD_TYPE_SUBRESOURCE_FILTER = 1,
18 AD_TYPE_ALL = 2,
19 AD_TYPE_MAX = AD_TYPE_ALL
20 };
21 using AdTypes = std::bitset<AD_TYPE_MAX>;
22
23 // Uses heuristics to determine if |navigation_handle| is a navigation for an
24 // ad. Must be called no earlier than
25 // NavigationHandleImpl::ReadyToCommitNavigation.
26 const AdTypes& GetDetectedAdTypes(content::NavigationHandle* navigation_handle);
27
28 // Marks the |navigation_handle| as loading an advertisment of a given |type|.
29 void SetDetectedAdTypes(content::NavigationHandle* navigation_handle,
30 AdType type);
31
32 #endif // CHROME_BROWSER_PAGE_LOAD_METRICS_ADS_DETECTION_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698