OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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 EXTENSIONS_COMMON_USER_SCRIPT_H_ | 5 #ifndef EXTENSIONS_COMMON_USER_SCRIPT_H_ |
6 #define EXTENSIONS_COMMON_USER_SCRIPT_H_ | 6 #define EXTENSIONS_COMMON_USER_SCRIPT_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 27 matching lines...) Expand all Loading... |
38 enum RunLocation { | 38 enum RunLocation { |
39 UNDEFINED, | 39 UNDEFINED, |
40 DOCUMENT_START, // After the documentElement is created, but before | 40 DOCUMENT_START, // After the documentElement is created, but before |
41 // anything else happens. | 41 // anything else happens. |
42 DOCUMENT_END, // After the entire document is parsed. Same as | 42 DOCUMENT_END, // After the entire document is parsed. Same as |
43 // DOMContentLoaded. | 43 // DOMContentLoaded. |
44 DOCUMENT_IDLE, // Sometime after DOMContentLoaded, as soon as the document | 44 DOCUMENT_IDLE, // Sometime after DOMContentLoaded, as soon as the document |
45 // is "idle". Currently this uses the simple heuristic of: | 45 // is "idle". Currently this uses the simple heuristic of: |
46 // min(DOM_CONTENT_LOADED + TIMEOUT, ONLOAD), but no | 46 // min(DOM_CONTENT_LOADED + TIMEOUT, ONLOAD), but no |
47 // particular injection point is guaranteed. | 47 // particular injection point is guaranteed. |
| 48 RUN_DEFERRED, // The user script's injection was deferred for permissions |
| 49 // reasons, and was executed at a later time. |
48 RUN_LOCATION_LAST // Leave this as the last item. | 50 RUN_LOCATION_LAST // Leave this as the last item. |
49 }; | 51 }; |
50 | 52 |
51 // Holds actual script file info. | 53 // Holds actual script file info. |
52 class File { | 54 class File { |
53 public: | 55 public: |
54 File(const base::FilePath& extension_root, | 56 File(const base::FilePath& extension_root, |
55 const base::FilePath& relative_path, | 57 const base::FilePath& relative_path, |
56 const GURL& url); | 58 const GURL& url); |
57 File(); | 59 File(); |
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
259 | 261 |
260 // True if the script should be injected into an incognito tab. | 262 // True if the script should be injected into an incognito tab. |
261 bool incognito_enabled_; | 263 bool incognito_enabled_; |
262 }; | 264 }; |
263 | 265 |
264 typedef std::vector<UserScript> UserScriptList; | 266 typedef std::vector<UserScript> UserScriptList; |
265 | 267 |
266 } // namespace extensions | 268 } // namespace extensions |
267 | 269 |
268 #endif // EXTENSIONS_COMMON_USER_SCRIPT_H_ | 270 #endif // EXTENSIONS_COMMON_USER_SCRIPT_H_ |
OLD | NEW |