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

Unified Diff: chrome/browser/extensions/api/tabs/tabs_api.cc

Issue 942533003: Enable <webview>.executeScript outside of Apps and Extensions [1] (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@decouple_brower_isolated_world_routingid_user_script_UserScriptSet_non_hostset_2
Patch Set: Add a test. Created 5 years, 9 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/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 4816da7e0687d8ce20a9b3f0af4717c47edc2252..229d89aaed2445c1b428504800768e261b4dedac 100644
--- a/chrome/browser/extensions/api/tabs/tabs_api.cc
+++ b/chrome/browser/extensions/api/tabs/tabs_api.cc
@@ -75,6 +75,7 @@
#include "extensions/common/constants.h"
#include "extensions/common/error_utils.h"
#include "extensions/common/extension.h"
+#include "extensions/common/host_id.h"
#include "extensions/common/manifest_constants.h"
#include "extensions/common/manifest_handlers/default_locale_handler.h"
#include "extensions/common/message_bundle.h"
@@ -1241,7 +1242,7 @@ bool TabsUpdateFunction::UpdateURL(const std::string &url_string,
}
TabHelper::FromWebContents(web_contents_)->script_executor()->ExecuteScript(
- extension_id(),
+ HostID(HostID::EXTENSIONS, extension_id()),
ScriptExecutor::JAVASCRIPT,
url.GetContent(),
ScriptExecutor::TOP_FRAME,
@@ -1731,6 +1732,7 @@ bool ExecuteCodeInTabFunction::Init() {
execute_tab_id_ = tab_id;
details_ = details.Pass();
+ set_host_id(HostID(HostID::EXTENSIONS, extension()->id()));
return true;
}

Powered by Google App Engine
This is Rietveld 408576698