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

Unified Diff: extensions/browser/api/execute_code_function.cc

Issue 952473002: Add frameId to executeScript/insertCSS (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix a few nits (review up to comment 16) Created 5 years, 10 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: extensions/browser/api/execute_code_function.cc
diff --git a/extensions/browser/api/execute_code_function.cc b/extensions/browser/api/execute_code_function.cc
index 21845aa47ec48b07e549e7b449c10d0641799358..e468f40b28f953d15f86141632c184481a7d44f9 100644
--- a/extensions/browser/api/execute_code_function.cc
+++ b/extensions/browser/api/execute_code_function.cc
@@ -139,7 +139,10 @@ bool ExecuteCodeFunction::Execute(const std::string& code_string) {
ScriptExecutor::FrameScope frame_scope =
details_->all_frames.get() && *details_->all_frames
? ScriptExecutor::ALL_FRAMES
- : ScriptExecutor::TOP_FRAME;
+ : ScriptExecutor::SINGLE_FRAME;
+
+ // If a frame_id is given, use it. Otherwise, use the top-level frame (0).
+ int frame_id = details_->frame_id.get() ? *details_->frame_id : 0;
ScriptExecutor::MatchAboutBlank match_about_blank =
details_->match_about_blank.get() && *details_->match_about_blank
@@ -166,6 +169,7 @@ bool ExecuteCodeFunction::Execute(const std::string& code_string) {
script_type,
code_string,
frame_scope,
+ frame_id,
match_about_blank,
run_at,
ScriptExecutor::ISOLATED_WORLD,
« no previous file with comments | « chrome/test/data/extensions/api_test/executescript/frame_id/test.js ('k') | extensions/browser/script_executor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698