| 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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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( | 51 bool PermissionsData::CanSilentlyIncreasePermissions( |
| 52 const Extension* extension) { | 52 const Extension* extension) { |
| 53 return extension->location() != Manifest::INTERNAL || | 53 return extension->location() != Manifest::INTERNAL; |
| 54 extension->creation_flags() & Extension::WAS_INSTALLED_BY_DEFAULT; | |
| 55 } | 54 } |
| 56 | 55 |
| 57 // static | 56 // static |
| 58 bool PermissionsData::CanExecuteScriptEverywhere(const Extension* extension) { | 57 bool PermissionsData::CanExecuteScriptEverywhere(const Extension* extension) { |
| 59 if (extension->location() == Manifest::COMPONENT) | 58 if (extension->location() == Manifest::COMPONENT) |
| 60 return true; | 59 return true; |
| 61 | 60 |
| 62 const ExtensionsClient::ScriptingWhitelist& whitelist = | 61 const ExtensionsClient::ScriptingWhitelist& whitelist = |
| 63 ExtensionsClient::Get()->GetScriptingWhitelist(); | 62 ExtensionsClient::Get()->GetScriptingWhitelist(); |
| 64 | 63 |
| (...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 364 return ACCESS_WITHHELD; | 363 return ACCESS_WITHHELD; |
| 365 | 364 |
| 366 if (error) { | 365 if (error) { |
| 367 *error = ErrorUtils::FormatErrorMessage(manifest_errors::kCannotAccessPage, | 366 *error = ErrorUtils::FormatErrorMessage(manifest_errors::kCannotAccessPage, |
| 368 document_url.spec()); | 367 document_url.spec()); |
| 369 } | 368 } |
| 370 return ACCESS_DENIED; | 369 return ACCESS_DENIED; |
| 371 } | 370 } |
| 372 | 371 |
| 373 } // namespace extensions | 372 } // namespace extensions |
| OLD | NEW |