| 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 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 286 location == Extension::EXTERNAL_POLICY_DOWNLOAD; | 286 location == Extension::EXTERNAL_POLICY_DOWNLOAD; |
| 287 } | 287 } |
| 288 | 288 |
| 289 // Whether extensions with |location| are auto-updatable or not. | 289 // Whether extensions with |location| are auto-updatable or not. |
| 290 static inline bool IsAutoUpdateableLocation(Location location) { | 290 static inline bool IsAutoUpdateableLocation(Location location) { |
| 291 // Only internal and external extensions can be autoupdated. | 291 // Only internal and external extensions can be autoupdated. |
| 292 return location == Extension::INTERNAL || | 292 return location == Extension::INTERNAL || |
| 293 IsExternalLocation(location); | 293 IsExternalLocation(location); |
| 294 } | 294 } |
| 295 | 295 |
| 296 // Whether extensions with |location| can be uninstalled or not. Policy | 296 // Policy-required extensions are silently auto-installed and updated, and |
| 297 // controlled extensions are silently auto-installed and updated, and cannot | 297 // cannot be disabled or modified by the user in any way. The same applies |
| 298 // be disabled by the user. The same applies for internal components. | 298 // to internal components. |
| 299 static inline bool UserMayDisable(Location location) { | 299 // This method is not generally called directly; instead, it is accessed |
| 300 return location != Extension::EXTERNAL_POLICY_DOWNLOAD && | 300 // through the ManagementPolicy held by the ExtensionSystem. |
| 301 location != Extension::COMPONENT; | 301 static inline bool IsRequired(Location location) { |
| 302 return location == Extension::EXTERNAL_POLICY_DOWNLOAD || |
| 303 location == Extension::COMPONENT; |
| 302 } | 304 } |
| 303 | 305 |
| 304 // Unpacked extensions start off with file access since they are a developer | 306 // Unpacked extensions start off with file access since they are a developer |
| 305 // feature. | 307 // feature. |
| 306 static inline bool ShouldAlwaysAllowFileAccess(Location location) { | 308 static inline bool ShouldAlwaysAllowFileAccess(Location location) { |
| 307 return location == Extension::LOAD; | 309 return location == Extension::LOAD; |
| 308 } | 310 } |
| 309 | 311 |
| 310 // Fills the |info| dictionary with basic information about the extension. | 312 // Fills the |info| dictionary with basic information about the extension. |
| 311 // |enabled| is injected for easier testing. | 313 // |enabled| is injected for easier testing. |
| (...skipping 800 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1112 | 1114 |
| 1113 UpdatedExtensionPermissionsInfo( | 1115 UpdatedExtensionPermissionsInfo( |
| 1114 const Extension* extension, | 1116 const Extension* extension, |
| 1115 const ExtensionPermissionSet* permissions, | 1117 const ExtensionPermissionSet* permissions, |
| 1116 Reason reason); | 1118 Reason reason); |
| 1117 }; | 1119 }; |
| 1118 | 1120 |
| 1119 } // namespace extensions | 1121 } // namespace extensions |
| 1120 | 1122 |
| 1121 #endif // CHROME_COMMON_EXTENSIONS_EXTENSION_H_ | 1123 #endif // CHROME_COMMON_EXTENSIONS_EXTENSION_H_ |
| OLD | NEW |