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

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

Issue 10443105: Take 2 at implementing activeTab. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: many more tests Created 8 years, 6 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_tabs_module.cc
diff --git a/chrome/browser/extensions/extension_tabs_module.cc b/chrome/browser/extensions/extension_tabs_module.cc
index af88edfc489825b66539c88d83f6fab14aab0478..8444e07c9b52df2ddc97b2ccafd4730f9ed2beb0 100644
--- a/chrome/browser/extensions/extension_tabs_module.cc
+++ b/chrome/browser/extensions/extension_tabs_module.cc
@@ -1223,7 +1223,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;
@@ -1287,6 +1287,7 @@ bool UpdateTabFunction::RunImpl() {
}
bool UpdateTabFunction::UpdateURLIfPresent(DictionaryValue* update_props,
+ int tab_id,
bool* is_async) {
if (!update_props->HasKey(keys::kUrlKey))
return true;
@@ -1313,7 +1314,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;
}
@@ -1626,8 +1627,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();

Powered by Google App Engine
This is Rietveld 408576698