| 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 10 matching lines...) Expand all Loading... |
| 21 | 21 |
| 22 // Represents a user script, either a standalone one, or one that is part of an | 22 // Represents a user script, either a standalone one, or one that is part of an |
| 23 // extension. | 23 // extension. |
| 24 class UserScript { | 24 class UserScript { |
| 25 public: | 25 public: |
| 26 // The file extension for standalone user scripts. | 26 // The file extension for standalone user scripts. |
| 27 static const char kFileExtension[]; | 27 static const char kFileExtension[]; |
| 28 | 28 |
| 29 // The bitmask for valid user script injectable schemes used by URLPattern. | 29 // The bitmask for valid user script injectable schemes used by URLPattern. |
| 30 enum { | 30 enum { |
| 31 kValidUserScriptSchemes = URLPattern::SCHEME_HTTP | | 31 kValidUserScriptSchemes = URLPattern::SCHEME_CHROMEUI | |
| 32 URLPattern::SCHEME_HTTP | |
| 32 URLPattern::SCHEME_HTTPS | | 33 URLPattern::SCHEME_HTTPS | |
| 33 URLPattern::SCHEME_FILE | | 34 URLPattern::SCHEME_FILE | |
| 34 URLPattern::SCHEME_FTP | 35 URLPattern::SCHEME_FTP |
| 35 }; | 36 }; |
| 36 | 37 |
| 37 // Check if a URL should be treated as a user script and converted to an | 38 // Check if a URL should be treated as a user script and converted to an |
| 38 // extension. | 39 // extension. |
| 39 static bool IsURLUserScript(const GURL& url, const std::string& mime_type); | 40 static bool IsURLUserScript(const GURL& url, const std::string& mime_type); |
| 40 | 41 |
| 41 // Locations that user scripts can be run inside the document. | 42 // Locations that user scripts can be run inside the document. |
| (...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 255 | 256 |
| 256 // True if the script should be injected into an incognito tab. | 257 // True if the script should be injected into an incognito tab. |
| 257 bool incognito_enabled_; | 258 bool incognito_enabled_; |
| 258 }; | 259 }; |
| 259 | 260 |
| 260 typedef std::vector<UserScript> UserScriptList; | 261 typedef std::vector<UserScript> UserScriptList; |
| 261 | 262 |
| 262 } // namespace extensions | 263 } // namespace extensions |
| 263 | 264 |
| 264 #endif // CHROME_COMMON_EXTENSIONS_USER_SCRIPT_H_ | 265 #endif // CHROME_COMMON_EXTENSIONS_USER_SCRIPT_H_ |
| OLD | NEW |