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

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

Issue 10863002: Added check to prevent extensions from injecting scrips into other extensions (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: added license comments Created 8 years, 4 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 #ifndef CHROME_COMMON_EXTENSIONS_EXTENSION_H_ 5 #ifndef CHROME_COMMON_EXTENSIONS_EXTENSION_H_
6 #define CHROME_COMMON_EXTENSIONS_EXTENSION_H_ 6 #define CHROME_COMMON_EXTENSIONS_EXTENSION_H_
7 7
8 #include <algorithm> 8 #include <algorithm>
9 #include <iosfwd> 9 #include <iosfwd>
10 #include <map> 10 #include <map>
(...skipping 513 matching lines...) Expand 10 before | Expand all | Expand 10 after
524 SkBitmap GetCachedImage(const ExtensionResource& source, 524 SkBitmap GetCachedImage(const ExtensionResource& source,
525 const gfx::Size& max_size) const; 525 const gfx::Size& max_size) const;
526 526
527 // Returns true if this extension can execute script on a page. If a 527 // Returns true if this extension can execute script on a page. If a
528 // UserScript object is passed, permission to run that specific script is 528 // UserScript object is passed, permission to run that specific script is
529 // checked (using its matches list). Otherwise, permission to execute script 529 // checked (using its matches list). Otherwise, permission to execute script
530 // programmatically is checked (using the extension's host permission). 530 // programmatically is checked (using the extension's host permission).
531 // 531 //
532 // This method is also aware of certain special pages that extensions are 532 // This method is also aware of certain special pages that extensions are
533 // usually not allowed to run script on. 533 // usually not allowed to run script on.
534 bool CanExecuteScriptOnPage(const GURL& page_url, 534 bool CanExecuteScriptOnPage(const GURL& document_url,
535 const GURL& top_document_url,
535 int tab_id, 536 int tab_id,
536 const UserScript* script, 537 const UserScript* script,
537 std::string* error) const; 538 std::string* error) const;
538 539
539 // Returns true if this extension is a COMPONENT extension, or if it is 540 // Returns true if this extension is a COMPONENT extension, or if it is
540 // on the whitelist of extensions that can script all pages. 541 // on the whitelist of extensions that can script all pages.
541 bool CanExecuteScriptEverywhere() const; 542 bool CanExecuteScriptEverywhere() const;
542 543
543 // Returns true if this extension is allowed to obtain the contents of a 544 // Returns true if this extension is allowed to obtain the contents of a
544 // page as an image. Since a page may contain sensitive information, this 545 // page as an image. Since a page may contain sensitive information, this
(...skipping 650 matching lines...) Expand 10 before | Expand all | Expand 10 after
1195 1196
1196 UpdatedExtensionPermissionsInfo( 1197 UpdatedExtensionPermissionsInfo(
1197 const Extension* extension, 1198 const Extension* extension,
1198 const PermissionSet* permissions, 1199 const PermissionSet* permissions,
1199 Reason reason); 1200 Reason reason);
1200 }; 1201 };
1201 1202
1202 } // namespace extensions 1203 } // namespace extensions
1203 1204
1204 #endif // CHROME_COMMON_EXTENSIONS_EXTENSION_H_ 1205 #endif // CHROME_COMMON_EXTENSIONS_EXTENSION_H_
OLDNEW
« no previous file with comments | « chrome/browser/extensions/content_script_apitest.cc ('k') | chrome/common/extensions/extension.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698