Index: chrome/browser/extensions/extension_tab_util.cc |
diff --git a/chrome/browser/extensions/extension_tab_util.cc b/chrome/browser/extensions/extension_tab_util.cc |
index f1ef9c051915e1d24062eb971a72d40fa3165e1e..163ebfb58aedf0684ac74420b5e376c7cf82f548 100644 |
--- a/chrome/browser/extensions/extension_tab_util.cc |
+++ b/chrome/browser/extensions/extension_tab_util.cc |
@@ -441,23 +441,24 @@ std::unique_ptr<api::tabs::MutedInfo> ExtensionTabUtil::CreateMutedInfo( |
void ExtensionTabUtil::ScrubTabForExtension(const Extension* extension, |
content::WebContents* contents, |
api::tabs::Tab* tab) { |
- DCHECK(extension); |
- |
- bool api_permission = false; |
- std::string url; |
- if (contents) { |
- api_permission = extension->permissions_data()->HasAPIPermissionForTab( |
- GetTabId(contents), APIPermission::kTab); |
- url = contents->GetURL().spec(); |
- } else { |
- api_permission = |
- extension->permissions_data()->HasAPIPermission(APIPermission::kTab); |
- url = *tab->url; |
+ bool has_permission = false; |
+ if (extension) { |
benwells
2017/02/07 07:13:07
It looks like this change is just making it so thi
jiaxi
2017/02/08 00:04:00
This function removes privacy sensitive fields if
benwells
2017/02/08 00:36:15
Ah right, it isn't equivalent to that snippet I pu
|
+ bool api_permission = false; |
+ std::string url; |
+ if (contents) { |
+ api_permission = extension->permissions_data()->HasAPIPermissionForTab( |
+ GetTabId(contents), APIPermission::kTab); |
+ url = contents->GetURL().spec(); |
+ } else { |
+ api_permission = |
+ extension->permissions_data()->HasAPIPermission(APIPermission::kTab); |
+ url = *tab->url; |
+ } |
+ bool host_permission = extension->permissions_data() |
+ ->active_permissions() |
+ .HasExplicitAccessToOrigin(GURL(url)); |
+ has_permission = api_permission || host_permission; |
} |
- bool host_permission = extension->permissions_data() |
- ->active_permissions() |
- .HasExplicitAccessToOrigin(GURL(url)); |
- bool has_permission = api_permission || host_permission; |
if (!has_permission) { |
tab->url.reset(); |
tab->title.reset(); |