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

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

Issue 2668693007: [MD Bookmarks] Double Click (Closed)
Patch Set: change the loop and add tab changes Created 3 years, 10 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
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();
« no previous file with comments | « no previous file | chrome/browser/resources/md_bookmarks/item.js » ('j') | chrome/common/extensions/api/_api_features.json » ('J')

Powered by Google App Engine
This is Rietveld 408576698