OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_COMMON_EXTENSIONS_USER_SCRIPT_H_ | 5 #ifndef CHROME_COMMON_EXTENSIONS_USER_SCRIPT_H_ |
6 #define CHROME_COMMON_EXTENSIONS_USER_SCRIPT_H_ | 6 #define CHROME_COMMON_EXTENSIONS_USER_SCRIPT_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 19 matching lines...) Expand all Loading... |
30 // extension. | 30 // extension. |
31 static bool IsURLUserScript(const GURL& url, const std::string& mime_type); | 31 static bool IsURLUserScript(const GURL& url, const std::string& mime_type); |
32 | 32 |
33 // Get the valid user script schemes for the current process. If | 33 // Get the valid user script schemes for the current process. If |
34 // canExecuteScriptEverywhere is true, this will return ALL_SCHEMES. | 34 // canExecuteScriptEverywhere is true, this will return ALL_SCHEMES. |
35 static int ValidUserScriptSchemes(bool canExecuteScriptEverywhere = false); | 35 static int ValidUserScriptSchemes(bool canExecuteScriptEverywhere = false); |
36 | 36 |
37 // Locations that user scripts can be run inside the document. | 37 // Locations that user scripts can be run inside the document. |
38 enum RunLocation { | 38 enum RunLocation { |
39 UNDEFINED, | 39 UNDEFINED, |
40 DOCUMENT_START, // After the documentElemnet 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_LOCATION_LAST // Leave this as the last item. | 48 RUN_LOCATION_LAST // Leave this as the last item. |
49 }; | 49 }; |
50 | 50 |
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
251 | 251 |
252 // True if the script should be injected into an incognito tab. | 252 // True if the script should be injected into an incognito tab. |
253 bool incognito_enabled_; | 253 bool incognito_enabled_; |
254 }; | 254 }; |
255 | 255 |
256 typedef std::vector<UserScript> UserScriptList; | 256 typedef std::vector<UserScript> UserScriptList; |
257 | 257 |
258 } // namespace extensions | 258 } // namespace extensions |
259 | 259 |
260 #endif // CHROME_COMMON_EXTENSIONS_USER_SCRIPT_H_ | 260 #endif // CHROME_COMMON_EXTENSIONS_USER_SCRIPT_H_ |
OLD | NEW |