| 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_EXTENSION_H_ | 5 #ifndef CHROME_COMMON_EXTENSIONS_EXTENSION_H_ |
| 6 #define CHROME_COMMON_EXTENSIONS_EXTENSION_H_ | 6 #define CHROME_COMMON_EXTENSIONS_EXTENSION_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <map> | 10 #include <map> |
| (...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 294 location == Extension::EXTERNAL_POLICY_DOWNLOAD; | 294 location == Extension::EXTERNAL_POLICY_DOWNLOAD; |
| 295 } | 295 } |
| 296 | 296 |
| 297 // Whether extensions with |location| are auto-updatable or not. | 297 // Whether extensions with |location| are auto-updatable or not. |
| 298 static inline bool IsAutoUpdateableLocation(Location location) { | 298 static inline bool IsAutoUpdateableLocation(Location location) { |
| 299 // Only internal and external extensions can be autoupdated. | 299 // Only internal and external extensions can be autoupdated. |
| 300 return location == Extension::INTERNAL || | 300 return location == Extension::INTERNAL || |
| 301 IsExternalLocation(location); | 301 IsExternalLocation(location); |
| 302 } | 302 } |
| 303 | 303 |
| 304 // Whether extensions with |location| can be uninstalled or not. Policy | 304 // Policy-required extensions are silently auto-installed and updated, and |
| 305 // controlled extensions are silently auto-installed and updated, and cannot | 305 // cannot be disabled or modified by the user in any way. The same applies |
| 306 // be disabled by the user. The same applies for internal components. | 306 // to internal components. |
| 307 static inline bool UserMayDisable(Location location) { | 307 // This method is not generally called directly; instead, it is accessed |
| 308 return location != Extension::EXTERNAL_POLICY_DOWNLOAD && | 308 // through the ManagementPolicy held by the ExtensionSystem. |
| 309 location != Extension::COMPONENT; | 309 static inline bool IsRequired(Location location) { |
| 310 return location == Extension::EXTERNAL_POLICY_DOWNLOAD || |
| 311 location == Extension::COMPONENT; |
| 310 } | 312 } |
| 311 | 313 |
| 312 // Whether extensions with |location| should be loaded with strict | 314 // Whether extensions with |location| should be loaded with strict |
| 313 // error checking. Strict error checks may flag errors older versions | 315 // error checking. Strict error checks may flag errors older versions |
| 314 // of chrome did not detect. To avoid breaking installed extensions, | 316 // of chrome did not detect. To avoid breaking installed extensions, |
| 315 // strict checks are disabled unless the location indicates that the | 317 // strict checks are disabled unless the location indicates that the |
| 316 // developer is loading the extension, or the extension is a component | 318 // developer is loading the extension, or the extension is a component |
| 317 // of chrome. | 319 // of chrome. |
| 318 static inline bool ShouldDoStrictErrorChecking(Location location) { | 320 static inline bool ShouldDoStrictErrorChecking(Location location) { |
| 319 return location == Extension::LOAD || | 321 return location == Extension::LOAD || |
| (...skipping 801 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1121 | 1123 |
| 1122 UpdatedExtensionPermissionsInfo( | 1124 UpdatedExtensionPermissionsInfo( |
| 1123 const Extension* extension, | 1125 const Extension* extension, |
| 1124 const ExtensionPermissionSet* permissions, | 1126 const ExtensionPermissionSet* permissions, |
| 1125 Reason reason); | 1127 Reason reason); |
| 1126 }; | 1128 }; |
| 1127 | 1129 |
| 1128 } // namespace extensions | 1130 } // namespace extensions |
| 1129 | 1131 |
| 1130 #endif // CHROME_COMMON_EXTENSIONS_EXTENSION_H_ | 1132 #endif // CHROME_COMMON_EXTENSIONS_EXTENSION_H_ |
| OLD | NEW |