OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 #ifndef CHROME_BROWSER_EXTENSIONS_ACTIVITY_LOG_ACTIVITY_ACTIONS_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_ACTIVITY_LOG_ACTIVITY_ACTIONS_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_ACTIVITY_LOG_ACTIVITY_ACTIONS_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_ACTIVITY_LOG_ACTIVITY_ACTIONS_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
178 private: | 178 private: |
179 friend class base::RefCountedThreadSafe<Action>; | 179 friend class base::RefCountedThreadSafe<Action>; |
180 | 180 |
181 // Returns true if a given |url| could be an ad. | 181 // Returns true if a given |url| could be an ad. |
182 bool UrlCouldBeAd(const GURL& url) const; | 182 bool UrlCouldBeAd(const GURL& url) const; |
183 | 183 |
184 // Uploads the URL to RAPPOR (preserving privacy) if this might have been an | 184 // Uploads the URL to RAPPOR (preserving privacy) if this might have been an |
185 // ad injection. | 185 // ad injection. |
186 void MaybeUploadUrl(rappor::RapporService* rappor_service) const; | 186 void MaybeUploadUrl(rappor::RapporService* rappor_service) const; |
187 | 187 |
188 // Checks an action that modified the src of an element for ad injection. | 188 // Checks an action that modified the src or href of an element for ad |
189 InjectionType CheckSrcModification() const; | 189 // injection. |
190 // Checks an action with the appendChild API for ad injection. | 190 InjectionType CheckAttrModification() const; |
191 // |ad_type_out| is populated with the type of ad which was injected, if there | 191 // Checks an action that adds an element for ad injection. |
192 // was an injection. | 192 InjectionType CheckElementAddition() const; |
193 InjectionType CheckAppendChild(AdType* ad_type_out) const; | |
194 // Checks a DOM object (e.g. an appended child) for ad injection. | |
195 // |ad_type_out| is populated with the type of ad which was injected, if there | |
196 // was an injection. | |
197 InjectionType CheckDomObject(const base::DictionaryValue* object, | |
198 AdType* ad_type_out) const; | |
199 | 193 |
200 std::string extension_id_; | 194 std::string extension_id_; |
201 base::Time time_; | 195 base::Time time_; |
202 ActionType action_type_; | 196 ActionType action_type_; |
203 std::string api_name_; | 197 std::string api_name_; |
204 scoped_ptr<base::ListValue> args_; | 198 scoped_ptr<base::ListValue> args_; |
205 GURL page_url_; | 199 GURL page_url_; |
206 std::string page_title_; | 200 std::string page_title_; |
207 bool page_incognito_; | 201 bool page_incognito_; |
208 GURL arg_url_; | 202 GURL arg_url_; |
(...skipping 18 matching lines...) Expand all Loading... |
227 // comparisons. | 221 // comparisons. |
228 struct ActionComparatorExcludingTimeAndActionId { | 222 struct ActionComparatorExcludingTimeAndActionId { |
229 // Evaluates the comparison lhs < rhs. | 223 // Evaluates the comparison lhs < rhs. |
230 bool operator()(const scoped_refptr<Action>& lhs, | 224 bool operator()(const scoped_refptr<Action>& lhs, |
231 const scoped_refptr<Action>& rhs) const; | 225 const scoped_refptr<Action>& rhs) const; |
232 }; | 226 }; |
233 | 227 |
234 } // namespace extensions | 228 } // namespace extensions |
235 | 229 |
236 #endif // CHROME_BROWSER_EXTENSIONS_ACTIVITY_LOG_ACTIVITY_ACTIONS_H_ | 230 #endif // CHROME_BROWSER_EXTENSIONS_ACTIVITY_LOG_ACTIVITY_ACTIONS_H_ |
OLD | NEW |