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

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

Issue 2946113002: Use FrameIsAd to decide whether to isolate a frame in TopDocumentIsolation mode. (Closed)
Patch Set: Undo accidental removal of components/task_scheduler_util/browser/DEPS 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.
jkarlin 2017/07/18 17:34:44 I'm not sure that this utility file belongs in thi
Charlie Harrison 2017/07/18 18:11:30 I would slightly prefer it to be in chrome/browser
Łukasz Anforowicz 2017/07/18 19:06:11 sgtm - I've moved ads_detection.h/.cc to chrome/br
Charlie Harrison 2017/07/18 19:24:41 Yeah, it would take some maneuvering to put it in
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_ADS_DETECTION_H_
6 #define CHROME_BROWSER_PAGE_LOAD_METRICS_OBSERVERS_ADS_DETECTION_H_
7
8 #include <bitset>
9 #include <string>
10
11 #include "base/strings/string_piece_forward.h"
12
13 namespace content {
14 class NavigationHandle;
15 } // namespace content
16
17 // The types of ads that one can detect or filter on.
18 enum AdType {
19 AD_TYPE_GOOGLE = 0,
20 AD_TYPE_SUBRESOURCE_FILTER = 1,
21 AD_TYPE_ALL = 2,
22 AD_TYPE_MAX = AD_TYPE_ALL
23 };
24 using AdTypes = std::bitset<AD_TYPE_MAX>;
25
26 // Uses various heuristics to determine if a given navigation tries to load an
27 // advertisment. For some ad types the results depend on
28 // SetNavigationAdHeuristics, but some ad types can be detected based on the
29 // basic navigation properties (like URL and/or name of the frame being
30 // navigated).
jkarlin 2017/07/18 17:34:44 Discussion about the SetNavigationAdHeuristics stu
Łukasz Anforowicz 2017/07/18 19:06:11 Done.
31 AdTypes GetAdDetectionHeuristics(content::NavigationHandle* navigation_handle);
jkarlin 2017/07/18 17:34:44 GetAdDetectionHeuristics sounds like it's returnin
Łukasz Anforowicz 2017/07/18 19:06:11 Done.
32
33 // Marks the |navigation_handle| as loading an advertisment of a given |type|.
34 void SetAdDetectionHeuristics(content::NavigationHandle* navigation_handle,
jkarlin 2017/07/18 17:34:44 Likewise, I much prefer SetDetectedAdType.
Łukasz Anforowicz 2017/07/18 19:06:11 Done.
35 AdType type);
36
37 #endif // CHROME_BROWSER_PAGE_LOAD_METRICS_OBSERVERS_ADS_DETECTION_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698