Index: chrome/browser/extensions/extension_tabs_module.cc |
diff --git a/chrome/browser/extensions/extension_tabs_module.cc b/chrome/browser/extensions/extension_tabs_module.cc |
index 226a72a36f41887d842a3eac7381ba8f9c6e124e..f832b9369acee04369333bf3e217a77cf701668e 100644 |
--- a/chrome/browser/extensions/extension_tabs_module.cc |
+++ b/chrome/browser/extensions/extension_tabs_module.cc |
@@ -1194,7 +1194,7 @@ bool UpdateTabFunction::RunImpl() { |
// Navigate the tab to a new location if the url is different. |
bool is_async = false; |
- if (!UpdateURLIfPresent(update_props, &is_async)) |
+ if (!UpdateURLIfPresent(update_props, tab_id, &is_async)) |
return false; |
bool active = false; |
@@ -1258,6 +1258,7 @@ bool UpdateTabFunction::RunImpl() { |
} |
bool UpdateTabFunction::UpdateURLIfPresent(DictionaryValue* update_props, |
+ int tab_id, |
bool* is_async) { |
if (!update_props->HasKey(keys::kUrlKey)) |
return true; |
@@ -1284,7 +1285,7 @@ bool UpdateTabFunction::UpdateURLIfPresent(DictionaryValue* update_props, |
// we need to check host permissions before allowing them. |
if (url.SchemeIs(chrome::kJavaScriptScheme)) { |
if (!GetExtension()->CanExecuteScriptOnPage( |
- tab_contents_->web_contents()->GetURL(), NULL, &error_)) { |
+ tab_contents_->web_contents()->GetURL(), tab_id, NULL, &error_)) { |
return false; |
} |
@@ -1597,8 +1598,12 @@ bool CaptureVisibleTabFunction::RunImpl() { |
// captureVisibleTab() can return an image containing sensitive information |
// that the browser would otherwise protect. Ensure the extension has |
// permission to do this. |
- if (!GetExtension()->CanCaptureVisiblePage(web_contents->GetURL(), &error_)) |
+ if (!GetExtension()->CanCaptureVisiblePage( |
+ web_contents->GetURL(), |
+ wrapper->extension_tab_helper()->GetTabId(), |
+ &error_)) { |
return false; |
+ } |
RenderViewHost* render_view_host = web_contents->GetRenderViewHost(); |
content::RenderWidgetHostView* view = render_view_host->GetView(); |