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

Side by Side Diff: extensions/common/manifest.h

Issue 24365004: Add EXTERNAL_POLICY to list of possible extension locations (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 2 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
OLDNEW
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_MANIFEST_H_ 5 #ifndef EXTENSIONS_COMMON_MANIFEST_H_
6 #define EXTENSIONS_COMMON_MANIFEST_H_ 6 #define EXTENSIONS_COMMON_MANIFEST_H_
7 7
8 #include <map> 8 #include <map>
9 #include <set> 9 #include <set>
10 #include <string> 10 #include <string>
(...skipping 22 matching lines...) Expand all
33 UNPACKED, // From loading an unpacked extension from the 33 UNPACKED, // From loading an unpacked extension from the
34 // extensions settings page. 34 // extensions settings page.
35 COMPONENT, // An integral component of Chrome itself, which 35 COMPONENT, // An integral component of Chrome itself, which
36 // happens to be implemented as an extension. We don't 36 // happens to be implemented as an extension. We don't
37 // show these in the management UI. 37 // show these in the management UI.
38 EXTERNAL_PREF_DOWNLOAD, // A crx file from an external directory (via 38 EXTERNAL_PREF_DOWNLOAD, // A crx file from an external directory (via
39 // prefs), installed from an update URL. 39 // prefs), installed from an update URL.
40 EXTERNAL_POLICY_DOWNLOAD, // A crx file from an external directory (via 40 EXTERNAL_POLICY_DOWNLOAD, // A crx file from an external directory (via
41 // admin policies), installed from an update URL. 41 // admin policies), installed from an update URL.
42 COMMAND_LINE, // --load-extension. 42 COMMAND_LINE, // --load-extension.
43 EXTERNAL_POLICY, // A crx file from an external directory (via admin
44 // policies).
not at google - send to devlin 2013/09/23 21:17:32 this explanation is awfully similar to EXTERNAL_PO
bartfab (slow) 2013/09/26 14:29:54 Done.
43 45
44 NUM_LOCATIONS 46 NUM_LOCATIONS
45 }; 47 };
46 48
47 // Do not change the order of entries or remove entries in this list 49 // Do not change the order of entries or remove entries in this list
48 // as this is used in UMA_HISTOGRAM_ENUMERATIONs about extensions. 50 // as this is used in UMA_HISTOGRAM_ENUMERATIONs about extensions.
49 enum Type { 51 enum Type {
50 TYPE_UNKNOWN = 0, 52 TYPE_UNKNOWN = 0,
51 TYPE_EXTENSION, 53 TYPE_EXTENSION,
52 TYPE_THEME, 54 TYPE_THEME,
53 TYPE_USER_SCRIPT, 55 TYPE_USER_SCRIPT,
54 TYPE_HOSTED_APP, 56 TYPE_HOSTED_APP,
55 // This is marked legacy because platform apps are preferred. For 57 // This is marked legacy because platform apps are preferred. For
56 // backwards compatibility, we can't remove support for packaged apps 58 // backwards compatibility, we can't remove support for packaged apps
57 TYPE_LEGACY_PACKAGED_APP, 59 TYPE_LEGACY_PACKAGED_APP,
58 TYPE_PLATFORM_APP, 60 TYPE_PLATFORM_APP,
59 TYPE_SHARED_MODULE 61 TYPE_SHARED_MODULE
60 }; 62 };
61 63
62 // Given two install sources, return the one which should take priority 64 // Given two install sources, return the one which should take priority
63 // over the other. If an extension is installed from two sources A and B, 65 // over the other. If an extension is installed from two sources A and B,
64 // its install source should be set to GetHigherPriorityLocation(A, B). 66 // its install source should be set to GetHigherPriorityLocation(A, B).
65 static Location GetHigherPriorityLocation(Location loc1, Location loc2); 67 static Location GetHigherPriorityLocation(Location loc1, Location loc2);
66 68
67 // Whether the |location| is external or not. 69 // Whether the |location| is external or not.
68 static inline bool IsExternalLocation(Location location) { 70 static inline bool IsExternalLocation(Location location) {
69 return location == EXTERNAL_PREF || 71 return location == EXTERNAL_PREF ||
70 location == EXTERNAL_REGISTRY || 72 location == EXTERNAL_REGISTRY ||
71 location == EXTERNAL_PREF_DOWNLOAD || 73 location == EXTERNAL_PREF_DOWNLOAD ||
74 location == EXTERNAL_POLICY ||
72 location == EXTERNAL_POLICY_DOWNLOAD; 75 location == EXTERNAL_POLICY_DOWNLOAD;
73 } 76 }
74 77
75 // Whether the |location| is unpacked (no CRX) or not. 78 // Whether the |location| is unpacked (no CRX) or not.
76 static inline bool IsUnpackedLocation(Location location) { 79 static inline bool IsUnpackedLocation(Location location) {
77 return location == UNPACKED || location == COMMAND_LINE; 80 return location == UNPACKED || location == COMMAND_LINE;
78 } 81 }
79 82
80 // Whether extensions with |location| are auto-updatable or not. 83 // Whether extensions with |location| are auto-updatable or not.
81 static inline bool IsAutoUpdateableLocation(Location location) { 84 static inline bool IsAutoUpdateableLocation(Location location) {
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 scoped_ptr<base::DictionaryValue> value_; 171 scoped_ptr<base::DictionaryValue> value_;
169 172
170 Type type_; 173 Type type_;
171 174
172 DISALLOW_COPY_AND_ASSIGN(Manifest); 175 DISALLOW_COPY_AND_ASSIGN(Manifest);
173 }; 176 };
174 177
175 } // namespace extensions 178 } // namespace extensions
176 179
177 #endif // EXTENSIONS_COMMON_MANIFEST_H_ 180 #endif // EXTENSIONS_COMMON_MANIFEST_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698