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

Unified Diff: chrome/browser/extensions/extension_tab_util.h

Issue 11824004: Do not pass URLs in onUpdated events to extensions unless they have the (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Update test Created 7 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/extensions/browser_event_router.cc ('k') | chrome/browser/extensions/extension_tab_util.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/extension_tab_util.h
diff --git a/chrome/browser/extensions/extension_tab_util.h b/chrome/browser/extensions/extension_tab_util.h
index 4e8e5c68c984d61c51057d08d14cbd91d92fa09d..3a8aa22139ddb83949bd5cb34134ecb96c83c7f2 100644
--- a/chrome/browser/extensions/extension_tab_util.h
+++ b/chrome/browser/extensions/extension_tab_util.h
@@ -45,6 +45,10 @@ class ExtensionTabUtil {
const Browser* browser,
const extensions::Extension* extension);
+ // Creates a Tab object (see chrome/common/extensions/api/tabs.json) with
+ // information about the state of a browser tab. Depending on the
+ // permissions of the extension, the object may or may not include sensitive
+ // data such as the tab's URL.
static base::DictionaryValue* CreateTabValue(
const content::WebContents* web_contents,
const extensions::Extension* extension) {
@@ -56,21 +60,23 @@ class ExtensionTabUtil {
int tab_index,
const extensions::Extension* extension);
- enum IncludePrivacySensitiveFields {
- INCLUDE_PRIVACY_SENSITIVE_FIELDS,
- OMIT_PRIVACY_SENSITIVE_FIELDS
- };
+ // Creates a Tab object but performs no extension permissions checks; the
+ // returned object will contain privacy-sensitive data.
static base::DictionaryValue* CreateTabValue(
- const content::WebContents* web_contents,
- IncludePrivacySensitiveFields include_privacy_sensitive_fields) {
- return CreateTabValue(web_contents, NULL, -1,
- include_privacy_sensitive_fields);
+ const content::WebContents* web_contents) {
+ return CreateTabValue(web_contents, NULL, -1);
}
static base::DictionaryValue* CreateTabValue(
const content::WebContents* web_contents,
TabStripModel* tab_strip,
- int tab_index,
- IncludePrivacySensitiveFields include_privacy_sensitive_fields);
+ int tab_index);
+
+ // Removes any privacy-sensitive fields from a Tab object if appropriate,
+ // given the permissions of the extension and the tab in question. The
+ // tab_info object is modified in place.
+ static void ScrubTabValueForExtension(const content::WebContents* contents,
+ const extensions::Extension* extension,
+ base::DictionaryValue* tab_info);
// Gets the |tab_strip_model| and |tab_index| for the given |web_contents|.
static bool GetTabStripModel(const content::WebContents* web_contents,
« no previous file with comments | « chrome/browser/extensions/browser_event_router.cc ('k') | chrome/browser/extensions/extension_tab_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698