| 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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 | 46 |
| 47 PermissionsData::~PermissionsData() { | 47 PermissionsData::~PermissionsData() { |
| 48 } | 48 } |
| 49 | 49 |
| 50 // static | 50 // static |
| 51 void PermissionsData::SetPolicyDelegate(PolicyDelegate* delegate) { | 51 void PermissionsData::SetPolicyDelegate(PolicyDelegate* delegate) { |
| 52 g_policy_delegate = delegate; | 52 g_policy_delegate = delegate; |
| 53 } | 53 } |
| 54 | 54 |
| 55 // static | 55 // static |
| 56 const PermissionsData* PermissionsData::ForExtension( | |
| 57 const Extension* extension) { | |
| 58 // TODO(rdevlin.cronin): Figure out what we're doing with this (i.e. whether | |
| 59 // or not we want to expose PermissionsData on the extension). | |
| 60 return extension->permissions_data(); | |
| 61 } | |
| 62 | |
| 63 // static | |
| 64 bool PermissionsData::CanSilentlyIncreasePermissions( | 56 bool PermissionsData::CanSilentlyIncreasePermissions( |
| 65 const Extension* extension) { | 57 const Extension* extension) { |
| 66 return extension->location() != Manifest::INTERNAL; | 58 return extension->location() != Manifest::INTERNAL; |
| 67 } | 59 } |
| 68 | 60 |
| 69 // static | 61 // static |
| 70 bool PermissionsData::CanExecuteScriptEverywhere(const Extension* extension) { | 62 bool PermissionsData::CanExecuteScriptEverywhere(const Extension* extension) { |
| 71 if (extension->location() == Manifest::COMPONENT) | 63 if (extension->location() == Manifest::COMPONENT) |
| 72 return true; | 64 return true; |
| 73 | 65 |
| (...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 307 GetTabSpecificPermissions(tab_id); | 299 GetTabSpecificPermissions(tab_id); |
| 308 if (tab_permissions.get() && | 300 if (tab_permissions.get() && |
| 309 tab_permissions->explicit_hosts().MatchesSecurityOrigin(url)) { | 301 tab_permissions->explicit_hosts().MatchesSecurityOrigin(url)) { |
| 310 return true; | 302 return true; |
| 311 } | 303 } |
| 312 } | 304 } |
| 313 return false; | 305 return false; |
| 314 } | 306 } |
| 315 | 307 |
| 316 } // namespace extensions | 308 } // namespace extensions |
| OLD | NEW |