Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1475)

Side by Side Diff: chrome/common/extensions/user_script.h

Issue 12792005: Allow extensions on chrome:// URLs, when flag is set and permission is explicitly requested (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: More cleanup Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/common/extensions/extension.cc ('k') | chrome/common/extensions/user_script.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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_
OLDNEW
« no previous file with comments | « chrome/common/extensions/extension.cc ('k') | chrome/common/extensions/user_script.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698