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

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

Issue 934753005: Automatically grant permissions to default-installed extensions (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: gah, comment 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
« no previous file with comments | « extensions/common/permissions/permissions_data.h ('k') | no next file » | 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) 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 #include "extensions/common/permissions/permissions_data.h" 5 #include "extensions/common/permissions/permissions_data.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "content/public/common/url_constants.h" 8 #include "content/public/common/url_constants.h"
9 #include "extensions/common/constants.h" 9 #include "extensions/common/constants.h"
10 #include "extensions/common/error_utils.h" 10 #include "extensions/common/error_utils.h"
(...skipping 30 matching lines...) Expand all
41 41
42 PermissionsData::~PermissionsData() { 42 PermissionsData::~PermissionsData() {
43 } 43 }
44 44
45 // static 45 // static
46 void PermissionsData::SetPolicyDelegate(PolicyDelegate* delegate) { 46 void PermissionsData::SetPolicyDelegate(PolicyDelegate* delegate) {
47 g_policy_delegate = delegate; 47 g_policy_delegate = delegate;
48 } 48 }
49 49
50 // static 50 // static
51 bool PermissionsData::CanSilentlyIncreasePermissions(
52 const Extension* extension) {
53 return extension->location() != Manifest::INTERNAL;
54 }
55
56 // static
57 bool PermissionsData::CanExecuteScriptEverywhere(const Extension* extension) { 51 bool PermissionsData::CanExecuteScriptEverywhere(const Extension* extension) {
58 if (extension->location() == Manifest::COMPONENT) 52 if (extension->location() == Manifest::COMPONENT)
59 return true; 53 return true;
60 54
61 const ExtensionsClient::ScriptingWhitelist& whitelist = 55 const ExtensionsClient::ScriptingWhitelist& whitelist =
62 ExtensionsClient::Get()->GetScriptingWhitelist(); 56 ExtensionsClient::Get()->GetScriptingWhitelist();
63 57
64 return std::find(whitelist.begin(), whitelist.end(), extension->id()) != 58 return std::find(whitelist.begin(), whitelist.end(), extension->id()) !=
65 whitelist.end(); 59 whitelist.end();
66 } 60 }
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after
363 return ACCESS_WITHHELD; 357 return ACCESS_WITHHELD;
364 358
365 if (error) { 359 if (error) {
366 *error = ErrorUtils::FormatErrorMessage(manifest_errors::kCannotAccessPage, 360 *error = ErrorUtils::FormatErrorMessage(manifest_errors::kCannotAccessPage,
367 document_url.spec()); 361 document_url.spec());
368 } 362 }
369 return ACCESS_DENIED; 363 return ACCESS_DENIED;
370 } 364 }
371 365
372 } // namespace extensions 366 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/common/permissions/permissions_data.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698