Chromium Code Reviews| 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..bdade56ff139403fd3cfbc1b1650ecc7dff16420 100644 |
| --- a/chrome/browser/extensions/extension_tab_util.h |
| +++ b/chrome/browser/extensions/extension_tab_util.h |
| @@ -45,6 +45,9 @@ class ExtensionTabUtil { |
| const Browser* browser, |
| const extensions::Extension* extension); |
| + // Creates a Tab object (a Javascript dictionary with information about the |
| + // status of a browser tab). Depending on the permissions of the extension, |
|
not at google - send to devlin
2013/01/09 02:04:29
"A Javascript dictionary..." is a bit misleading,
mvrable
2013/01/09 19:25:35
Done.
|
| + // 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 +59,24 @@ 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 base::DictionaryValue* 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, |