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 1810 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1821 Value* allow_js_access = NULL; | 1821 Value* allow_js_access = NULL; |
1822 if (!manifest_->Get(keys::kBackgroundAllowJsAccess, &allow_js_access)) | 1822 if (!manifest_->Get(keys::kBackgroundAllowJsAccess, &allow_js_access)) |
1823 return true; | 1823 return true; |
1824 | 1824 |
1825 if (!allow_js_access->IsType(Value::TYPE_BOOLEAN) || | 1825 if (!allow_js_access->IsType(Value::TYPE_BOOLEAN) || |
1826 !allow_js_access->GetAsBoolean(&allow_background_js_access_)) { | 1826 !allow_js_access->GetAsBoolean(&allow_background_js_access_)) { |
1827 *error = ASCIIToUTF16(errors::kInvalidBackgroundAllowJsAccess); | 1827 *error = ASCIIToUTF16(errors::kInvalidBackgroundAllowJsAccess); |
1828 return false; | 1828 return false; |
1829 } | 1829 } |
1830 | 1830 |
1831 if (!has_background_page()) { | |
1832 *error = ASCIIToUTF16(errors::kInvalidBackgroundAllowJsAccessNoPage); | |
1833 return false; | |
1834 } | |
1835 | |
1836 return true; | 1831 return true; |
1837 } | 1832 } |
1838 | 1833 |
1839 bool Extension::LoadWebIntentAction(const std::string& action_name, | 1834 bool Extension::LoadWebIntentAction(const std::string& action_name, |
1840 const DictionaryValue& intent_service, | 1835 const DictionaryValue& intent_service, |
1841 string16* error) { | 1836 string16* error) { |
1842 DCHECK(error); | 1837 DCHECK(error); |
1843 webkit_glue::WebIntentServiceData service; | 1838 webkit_glue::WebIntentServiceData service; |
1844 std::string value; | 1839 std::string value; |
1845 | 1840 |
(...skipping 1684 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3530 already_disabled(false), | 3525 already_disabled(false), |
3531 extension(extension) {} | 3526 extension(extension) {} |
3532 | 3527 |
3533 UpdatedExtensionPermissionsInfo::UpdatedExtensionPermissionsInfo( | 3528 UpdatedExtensionPermissionsInfo::UpdatedExtensionPermissionsInfo( |
3534 const Extension* extension, | 3529 const Extension* extension, |
3535 const ExtensionPermissionSet* permissions, | 3530 const ExtensionPermissionSet* permissions, |
3536 Reason reason) | 3531 Reason reason) |
3537 : reason(reason), | 3532 : reason(reason), |
3538 extension(extension), | 3533 extension(extension), |
3539 permissions(permissions) {} | 3534 permissions(permissions) {} |
OLD | NEW |