Chromium Code Reviews| OLD | NEW |
|---|---|
| (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_ | |
| OLD | NEW |