| 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 9f437f22a9d87efc8707228917ac562fe316ab9a..cf0bab453bf18a76547f9e7bcd15f231bfe593b7 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;
|
| @@ -1627,8 +1626,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();
|
| @@ -1656,14 +1656,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;
|
| }
|
|
|
|
|