| OLD | NEW |
| 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 "chrome/common/extensions/ad_injection_constants.h" | 5 #include "chrome/common/extensions/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 { |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 const char kHtmlEmbedSrcApiName[] = "HTMLEmbedElement.src"; | 22 const char kHtmlEmbedSrcApiName[] = "HTMLEmbedElement.src"; |
| 23 const char kAppendChildApiSuffix[] = "appendChild"; | 23 const char kAppendChildApiSuffix[] = "appendChild"; |
| 24 | 24 |
| 25 // The maximum number of children to check when we examine a newly-added | 25 // The maximum number of children to check when we examine a newly-added |
| 26 // element. | 26 // element. |
| 27 extern const size_t kMaximumChildrenToCheck = 10u; | 27 extern const size_t kMaximumChildrenToCheck = 10u; |
| 28 | 28 |
| 29 // The maximum depth to check when we examine a newly-added element. | 29 // The maximum depth to check when we examine a newly-added element. |
| 30 extern const size_t kMaximumDepthToCheck = 5u; | 30 extern const size_t kMaximumDepthToCheck = 5u; |
| 31 | 31 |
| 32 bool ApiCanInjectAds(const char* api) { | 32 bool ApiCanInjectAds(const std::string& api) { |
| 33 return api == kHtmlIframeSrcApiName || | 33 return api == kHtmlIframeSrcApiName || |
| 34 api == kHtmlEmbedSrcApiName || | 34 api == kHtmlEmbedSrcApiName || |
| 35 EndsWith(api, kAppendChildApiSuffix, true /* case sensitive */); | 35 EndsWith(api, kAppendChildApiSuffix, true /* case sensitive */); |
| 36 } | 36 } |
| 37 | 37 |
| 38 } // namespace ad_injection_constants | 38 } // namespace ad_injection_constants |
| 39 } // namespace extensions | 39 } // namespace extensions |
| OLD | NEW |