Index: chrome/browser/extensions/api/tabs/tabs_api.cc |
diff --git a/chrome/browser/extensions/api/tabs/tabs_api.cc b/chrome/browser/extensions/api/tabs/tabs_api.cc |
index e9e6b82bb2f46e56ec3816a66ce015dc5a56a898..8316ceb3edec6e6ead9f44fbd8fde3a9f04bb89f 100644 |
--- a/chrome/browser/extensions/api/tabs/tabs_api.cc |
+++ b/chrome/browser/extensions/api/tabs/tabs_api.cc |
@@ -1178,14 +1178,14 @@ bool TabsUpdateFunction::UpdateURL(const std::string &url_string, |
// we need to check host permissions before allowing them. |
if (url.SchemeIs(url::kJavaScriptScheme)) { |
content::RenderProcessHost* process = web_contents_->GetRenderProcessHost(); |
- if (!PermissionsData::CanExecuteScriptOnPage( |
- GetExtension(), |
- web_contents_->GetURL(), |
- web_contents_->GetURL(), |
- tab_id, |
- NULL, |
- process ? process->GetID() : -1, |
- &error_)) { |
+ if (!PermissionsData::ForExtension(GetExtension()) |
+ ->CanExecuteScriptOnPage(GetExtension(), |
+ web_contents_->GetURL(), |
+ web_contents_->GetURL(), |
+ tab_id, |
+ NULL, |
+ process ? process->GetID() : -1, |
+ &error_)) { |
return false; |
} |
@@ -1504,9 +1504,8 @@ WebContents* TabsCaptureVisibleTabFunction::GetWebContentsForID(int window_id) { |
return NULL; |
} |
- if (!PermissionsData::CanCaptureVisiblePage(GetExtension(), |
- SessionID::IdForTab(contents), |
- &error_)) { |
+ if (!PermissionsData::ForExtension(GetExtension()) |
+ ->CanCaptureVisiblePage(SessionID::IdForTab(contents), &error_)) { |
return NULL; |
} |
return contents; |
@@ -1622,8 +1621,9 @@ ExecuteCodeInTabFunction::ExecuteCodeInTabFunction() |
ExecuteCodeInTabFunction::~ExecuteCodeInTabFunction() {} |
bool ExecuteCodeInTabFunction::HasPermission() { |
- if (Init() && PermissionsData::HasAPIPermissionForTab( |
- extension_.get(), execute_tab_id_, APIPermission::kTab)) { |
+ if (Init() && |
+ PermissionsData::ForExtension(extension_) |
+ ->HasAPIPermissionForTab(execute_tab_id_, APIPermission::kTab)) { |
return true; |
} |
return ExtensionFunction::HasPermission(); |
@@ -1651,14 +1651,14 @@ bool ExecuteCodeInTabFunction::CanExecuteScriptOnPage() { |
// NOTE: This can give the wrong answer due to race conditions, but it is OK, |
// we check again in the renderer. |
content::RenderProcessHost* process = contents->GetRenderProcessHost(); |
- if (!PermissionsData::CanExecuteScriptOnPage( |
- GetExtension(), |
- contents->GetURL(), |
- contents->GetURL(), |
- execute_tab_id_, |
- NULL, |
- process ? process->GetID() : -1, |
- &error_)) { |
+ if (!PermissionsData::ForExtension(GetExtension()) |
+ ->CanExecuteScriptOnPage(GetExtension(), |
+ contents->GetURL(), |
+ contents->GetURL(), |
+ execute_tab_id_, |
+ NULL, |
+ process ? process->GetID() : -1, |
+ &error_)) { |
return false; |
} |