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

Side by Side Diff: chrome/common/extensions/permissions/api_permission_set.cc

Issue 23506021: Require confirmation for writable directory access. (Closed) Base URL: http://git.chromium.org/chromium/src.git@directory-permission-hack
Patch Set: Created 7 years, 3 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) 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 #include "chrome/common/extensions/permissions/api_permission_set.h" 5 #include "chrome/common/extensions/permissions/api_permission_set.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/stl_util.h"
8 #include "base/strings/string_number_conversions.h" 9 #include "base/strings/string_number_conversions.h"
9 #include "base/values.h" 10 #include "base/values.h"
10 #include "chrome/common/extensions/extension_manifest_constants.h" 11 #include "chrome/common/extensions/extension_manifest_constants.h"
11 #include "chrome/common/extensions/permissions/permissions_info.h" 12 #include "chrome/common/extensions/permissions/permissions_info.h"
12 #include "extensions/common/error_utils.h" 13 #include "extensions/common/error_utils.h"
13 14
14 namespace errors = extension_manifest_errors; 15 namespace errors = extension_manifest_errors;
15 16
16 namespace { 17 namespace {
17 18
(...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after
328 continue; 329 continue;
329 } 330 }
330 331
331 if (!CreateAPIPermission(permission_str, permission_value, source, 332 if (!CreateAPIPermission(permission_str, permission_value, source,
332 api_permissions, error, unhandled_permissions)) 333 api_permissions, error, unhandled_permissions))
333 return false; 334 return false;
334 } 335 }
335 return true; 336 return true;
336 } 337 }
337 338
339 void APIPermissionSet::AddImpliedPermissions() {
340 // The fileSystem.write and fileSystem.directory permissions imply
341 // fileSystem.writeDirectory.
342 if (ContainsKey(map_, APIPermission::kFileSystemWrite) &&
343 ContainsKey(map_, APIPermission::kFileSystemDirectory)) {
344 insert(APIPermission::kFileSystemWriteDirectory);
not at google - send to devlin 2013/09/03 17:07:04 Ugh so busted. But I agree that there doesn't seem
Sam McNally 2013/09/04 00:21:30 Done.
345 }
346 }
347
338 } // namespace extensions 348 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698