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

Side by Side Diff: extensions/common/ad_injection_constants.cc

Issue 270623005: Update ActivityLog detection to use previous values, hrefs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 7 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
« no previous file with comments | « extensions/common/ad_injection_constants.h ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "extensions/common/ad_injection_constants.h" 5 #include "extensions/common/ad_injection_constants.h"
6 6
7 #include "base/strings/string_util.h" 7 #include "base/strings/string_util.h"
8 8
9 namespace extensions { 9 namespace extensions {
10 namespace ad_injection_constants { 10 namespace ad_injection_constants {
11 11
12 namespace keys { 12 namespace keys {
13 13
14 const char kType[] = "type"; 14 const char kType[] = "type";
15 const char kChildren[] = "children"; 15 const char kChildren[] = "children";
16 const char kSrc[] = "src"; 16 const char kSrc[] = "src";
17 const char kHref[] = "href"; 17 const char kHref[] = "href";
18 18
19 } // namespace keys 19 } // namespace keys
20 20
21 const char kHtmlIframeSrcApiName[] = "HTMLIFrameElement.src"; 21 const char kHtmlIframeSrcApiName[] = "HTMLIFrameElement.src";
22 const char kHtmlEmbedSrcApiName[] = "HTMLEmbedElement.src"; 22 const char kHtmlEmbedSrcApiName[] = "HTMLEmbedElement.src";
23 const char kHtmlAnchorHrefApiName[] = "HTMLAnchorElement.href";
23 const char kAppendChildApiSuffix[] = "appendChild"; 24 const char kAppendChildApiSuffix[] = "appendChild";
24 25
25 // The maximum number of children to check when we examine a newly-added 26 // The maximum number of children to check when we examine a newly-added
26 // element. 27 // element.
27 extern const size_t kMaximumChildrenToCheck = 10u; 28 extern const size_t kMaximumChildrenToCheck = 10u;
28 29
29 // The maximum depth to check when we examine a newly-added element. 30 // The maximum depth to check when we examine a newly-added element.
30 extern const size_t kMaximumDepthToCheck = 5u; 31 extern const size_t kMaximumDepthToCheck = 5u;
31 32
32 bool ApiCanInjectAds(const std::string& api) { 33 bool ApiCanInjectAds(const std::string& api) {
33 return api == kHtmlIframeSrcApiName || 34 return api == kHtmlIframeSrcApiName ||
34 api == kHtmlEmbedSrcApiName || 35 api == kHtmlEmbedSrcApiName ||
36 api == kHtmlAnchorHrefApiName ||
35 EndsWith(api, kAppendChildApiSuffix, true /* case sensitive */); 37 EndsWith(api, kAppendChildApiSuffix, true /* case sensitive */);
36 } 38 }
37 39
38 } // namespace ad_injection_constants 40 } // namespace ad_injection_constants
39 } // namespace extensions 41 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/common/ad_injection_constants.h ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698