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

Unified Diff: chrome/common/extensions/user_script.h

Issue 412008: Introduce a new 'all_frames' property to content scripts and (Closed)
Patch Set: responses to comments Created 11 years, 1 month 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
« no previous file with comments | « chrome/common/extensions/extension_constants.cc ('k') | chrome/common/extensions/user_script.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/extensions/user_script.h
diff --git a/chrome/common/extensions/user_script.h b/chrome/common/extensions/user_script.h
index adcfa3fcf27a507a1ab8c2c454a4036c5371b5a6..b7093c1494e5756f92cd5f5ad567e9b267090e0d 100644
--- a/chrome/common/extensions/user_script.h
+++ b/chrome/common/extensions/user_script.h
@@ -102,7 +102,8 @@ class UserScript {
// Constructor. Default the run location to document end, which is like
// Greasemonkey and probably more useful for typical scripts.
UserScript()
- : run_location_(DOCUMENT_IDLE), emulate_greasemonkey_(false) {
+ : run_location_(DOCUMENT_IDLE), emulate_greasemonkey_(false),
+ match_all_frames_(false) {
}
const std::string& name_space() const { return name_space_; }
@@ -126,6 +127,10 @@ class UserScript {
bool emulate_greasemonkey() const { return emulate_greasemonkey_; }
void set_emulate_greasemonkey(bool val) { emulate_greasemonkey_ = val; }
+ // Whether to match all frames, or only the top one.
+ bool match_all_frames() const { return match_all_frames_; }
+ void set_match_all_frames(bool val) { match_all_frames_ = val; }
+
// The globs, if any, that determine which pages this script runs against.
// These are only used with "standalone" Greasemonkey-like user scripts.
const std::vector<std::string>& globs() const { return globs_; }
@@ -209,6 +214,10 @@ class UserScript {
// Whether we should try to emulate Greasemonkey's APIs when running this
// script.
bool emulate_greasemonkey_;
+
+ // Whether the user script should run in all frames, or only just the top one.
+ // Defaults to false.
+ bool match_all_frames_;
};
typedef std::vector<UserScript> UserScriptList;
« no previous file with comments | « chrome/common/extensions/extension_constants.cc ('k') | chrome/common/extensions/user_script.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698