| 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,
|
|
|