OLD | NEW |
---|---|
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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
44 } | 44 } |
45 | 45 |
46 // static | 46 // static |
47 void PermissionsData::SetPolicyDelegate(PolicyDelegate* delegate) { | 47 void PermissionsData::SetPolicyDelegate(PolicyDelegate* delegate) { |
48 g_policy_delegate = delegate; | 48 g_policy_delegate = delegate; |
49 } | 49 } |
50 | 50 |
51 // static | 51 // static |
52 bool PermissionsData::CanSilentlyIncreasePermissions( | 52 bool PermissionsData::CanSilentlyIncreasePermissions( |
53 const Extension* extension) { | 53 const Extension* extension) { |
54 return extension->location() != Manifest::INTERNAL; | 54 return extension->location() != Manifest::INTERNAL || |
55 extension->creation_flags() & Extension::WAS_INSTALLED_BY_DEFAULT; | |
not at google - send to devlin
2015/02/17 17:07:24
Hm, seems odd that EXTERNAL_PREF/REGISTRY isn't ex
| |
55 } | 56 } |
56 | 57 |
57 // static | 58 // static |
58 bool PermissionsData::CanExecuteScriptEverywhere(const Extension* extension) { | 59 bool PermissionsData::CanExecuteScriptEverywhere(const Extension* extension) { |
59 if (extension->location() == Manifest::COMPONENT) | 60 if (extension->location() == Manifest::COMPONENT) |
60 return true; | 61 return true; |
61 | 62 |
62 const ExtensionsClient::ScriptingWhitelist& whitelist = | 63 const ExtensionsClient::ScriptingWhitelist& whitelist = |
63 ExtensionsClient::Get()->GetScriptingWhitelist(); | 64 ExtensionsClient::Get()->GetScriptingWhitelist(); |
64 | 65 |
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
360 return ACCESS_WITHHELD; | 361 return ACCESS_WITHHELD; |
361 | 362 |
362 if (error) { | 363 if (error) { |
363 *error = ErrorUtils::FormatErrorMessage(manifest_errors::kCannotAccessPage, | 364 *error = ErrorUtils::FormatErrorMessage(manifest_errors::kCannotAccessPage, |
364 document_url.spec()); | 365 document_url.spec()); |
365 } | 366 } |
366 return ACCESS_DENIED; | 367 return ACCESS_DENIED; |
367 } | 368 } |
368 | 369 |
369 } // namespace extensions | 370 } // namespace extensions |
OLD | NEW |