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

Side by Side Diff: extensions/common/permissions/permissions_data.h

Issue 934753005: Automatically grant permissions to default-installed extensions (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: cleanup Created 5 years, 10 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
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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_PERMISSIONS_PERMISSIONS_DATA_H_ 5 #ifndef EXTENSIONS_COMMON_PERMISSIONS_PERMISSIONS_DATA_H_
6 #define EXTENSIONS_COMMON_PERMISSIONS_PERMISSIONS_DATA_H_ 6 #define EXTENSIONS_COMMON_PERMISSIONS_PERMISSIONS_DATA_H_
7 7
8 #include <map> 8 #include <map>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 int tab_id, 51 int tab_id,
52 int process_id, 52 int process_id,
53 std::string* error) = 0; 53 std::string* error) = 0;
54 }; 54 };
55 55
56 static void SetPolicyDelegate(PolicyDelegate* delegate); 56 static void SetPolicyDelegate(PolicyDelegate* delegate);
57 57
58 PermissionsData(const Extension* extension); 58 PermissionsData(const Extension* extension);
59 virtual ~PermissionsData(); 59 virtual ~PermissionsData();
60 60
61 // Returns true if the |extension| can silently increase its permission level.
62 // Users must approve permissions for unpacked and packed extensions in the
63 // following situations:
64 // - when installing or upgrading packed extensions
65 // - when installing unpacked extensions that have NPAPI plugins
66 // - when either type of extension requests optional permissions
67 static bool CanSilentlyIncreasePermissions(const Extension* extension);
68
69 // Returns true if the extension is a COMPONENT extension or is on the 61 // Returns true if the extension is a COMPONENT extension or is on the
70 // whitelist of extensions that can script all pages. 62 // whitelist of extensions that can script all pages.
71 static bool CanExecuteScriptEverywhere(const Extension* extension); 63 static bool CanExecuteScriptEverywhere(const Extension* extension);
72 64
73 // Returns true if we should skip the permisisons warning for the extension 65 // Returns true if we should skip the permisisons warning for the extension
74 // with the given |extension_id|. 66 // with the given |extension_id|.
75 static bool ShouldSkipPermissionWarnings(const std::string& extension_id); 67 static bool ShouldSkipPermissionWarnings(const std::string& extension_id);
76 68
77 // Returns true if the given |url| is restricted for the given |extension|, 69 // Returns true if the given |url| is restricted for the given |extension|,
78 // as is commonly the case for chrome:// urls. 70 // as is commonly the case for chrome:// urls.
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
269 mutable scoped_refptr<const PermissionSet> withheld_permissions_unsafe_; 261 mutable scoped_refptr<const PermissionSet> withheld_permissions_unsafe_;
270 262
271 mutable TabPermissionsMap tab_specific_permissions_; 263 mutable TabPermissionsMap tab_specific_permissions_;
272 264
273 DISALLOW_COPY_AND_ASSIGN(PermissionsData); 265 DISALLOW_COPY_AND_ASSIGN(PermissionsData);
274 }; 266 };
275 267
276 } // namespace extensions 268 } // namespace extensions
277 269
278 #endif // EXTENSIONS_COMMON_PERMISSIONS_PERMISSIONS_DATA_H_ 270 #endif // EXTENSIONS_COMMON_PERMISSIONS_PERMISSIONS_DATA_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698