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

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

Issue 10382149: Refactor the various ways to control what users can do to extensions. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 6 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/chrome_tests.gypi ('k') | chrome/common/extensions/extension.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_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
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
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_
OLDNEW
« no previous file with comments | « chrome/chrome_tests.gypi ('k') | chrome/common/extensions/extension.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698