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

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 2 more CR comments from csharrison@. 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
jkarlin 2017/07/19 13:32:36 This file should be in the page_load_metrics names
Łukasz Anforowicz 2017/07/19 18:11:29 Done.
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,
jkarlin 2017/07/19 13:32:36 s/SetDetectedAdTypes/SetDetectedAdType/
Łukasz Anforowicz 2017/07/19 18:11:29 Done.
30 AdType type);
31
32 #endif // CHROME_BROWSER_PAGE_LOAD_METRICS_ADS_DETECTION_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698