Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(231)

Side by Side Diff: chrome/common/extensions/extension.cc

Issue 9837074: Make it so that allow_js_access: false can be used with background pages created by window.open. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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);
Charlie Reis 2012/03/26 17:56:51 Normally, we expect people to set allow_js_access
Mihai Parparita -not on Chrome 2012/03/27 01:16:07 Not quite sure I understand this. Being able to cr
Charlie Reis 2012/03/27 23:19:27 Here's what I meant. Suppose the manifest looked
Mihai Parparita -not on Chrome 2012/03/28 20:29:01 I'm pretty sure this was legal, and that manifest
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
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) {}
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698