| OLD | NEW |
| 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/extension.h" | 5 #include "chrome/common/extensions/extension.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/base64.h" | 9 #include "base/base64.h" |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 375 | 375 |
| 376 GURL Extension::GetBackgroundURL() const { | 376 GURL Extension::GetBackgroundURL() const { |
| 377 if (!background_scripts_.empty()) { | 377 if (!background_scripts_.empty()) { |
| 378 return GetResourceURL( | 378 return GetResourceURL( |
| 379 extension_filenames::kGeneratedBackgroundPageFilename); | 379 extension_filenames::kGeneratedBackgroundPageFilename); |
| 380 } else { | 380 } else { |
| 381 return background_url_; | 381 return background_url_; |
| 382 } | 382 } |
| 383 } | 383 } |
| 384 | 384 |
| 385 bool Extension::RequiresSeparateUserDataDirectory() const { |
| 386 // Currently separate data directories are only supported on Mac OSX. |
| 387 #if defined(OS_MACOSX) |
| 388 return is_platform_app(); |
| 389 #else |
| 390 return false; |
| 391 #endif |
| 392 } |
| 393 |
| 385 bool Extension::IsResourceWebAccessible(const std::string& relative_path) | 394 bool Extension::IsResourceWebAccessible(const std::string& relative_path) |
| 386 const { | 395 const { |
| 387 // For old manifest versions which do not specify web_accessible_resources | 396 // For old manifest versions which do not specify web_accessible_resources |
| 388 // we always allow resource loads. | 397 // we always allow resource loads. |
| 389 if (manifest_version() < 2 && !HasWebAccessibleResources()) | 398 if (manifest_version() < 2 && !HasWebAccessibleResources()) |
| 390 return true; | 399 return true; |
| 391 | 400 |
| 392 if (web_accessible_resources_.find(relative_path) != | 401 if (web_accessible_resources_.find(relative_path) != |
| 393 web_accessible_resources_.end()) | 402 web_accessible_resources_.end()) |
| 394 return true; | 403 return true; |
| (...skipping 2671 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3066 already_disabled(false), | 3075 already_disabled(false), |
| 3067 extension(extension) {} | 3076 extension(extension) {} |
| 3068 | 3077 |
| 3069 UpdatedExtensionPermissionsInfo::UpdatedExtensionPermissionsInfo( | 3078 UpdatedExtensionPermissionsInfo::UpdatedExtensionPermissionsInfo( |
| 3070 const Extension* extension, | 3079 const Extension* extension, |
| 3071 const ExtensionPermissionSet* permissions, | 3080 const ExtensionPermissionSet* permissions, |
| 3072 Reason reason) | 3081 Reason reason) |
| 3073 : reason(reason), | 3082 : reason(reason), |
| 3074 extension(extension), | 3083 extension(extension), |
| 3075 permissions(permissions) {} | 3084 permissions(permissions) {} |
| OLD | NEW |