Lines Matching refs:script

43     *error = base::ASCIIToUTF16("User script must be UTF8 encoded.");
47 UserScript script;
48 if (!UserScriptLoader::ParseMetadataHeader(content, &script)) {
49 *error = base::ASCIIToUTF16("Invalid script header.");
70 if (!script.name().empty() && !script.name_space().empty())
71 script_name = script.name_space() + "/" + script.name();
77 // its unique identity, and we need one of those. A user script's unique
86 // The script may not have a name field, but we need one for an extension. If
88 if (!script.name().empty())
89 root->SetString(keys::kName, script.name());
95 if (!script.version().empty())
96 root->SetString(keys::kVersion, script.version());
100 root->SetString(keys::kDescription, script.description());
105 js_files->Append(new base::StringValue("script.js"));
107 // If the script provides its own match patterns, we use those. Otherwise, we
110 if (!script.url_patterns().is_empty()) {
111 for (URLPatternSet::const_iterator i = script.url_patterns().begin();
112 i != script.url_patterns().end(); ++i) {
123 if (!script.exclude_url_patterns().is_empty()) {
125 script.exclude_url_patterns().begin();
126 i != script.exclude_url_patterns().end(); ++i) {
132 for (size_t i = 0; i < script.globs().size(); ++i)
133 includes->Append(new base::StringValue(script.globs().at(i)));
136 for (size_t i = 0; i < script.exclude_globs().size(); ++i)
137 excludes->Append(new base::StringValue(script.exclude_globs().at(i)));
146 if (script.run_location() == UserScript::DOCUMENT_START)
148 else if (script.run_location() == UserScript::DOCUMENT_END)
150 else if (script.run_location() == UserScript::DOCUMENT_IDLE)
166 // Write the script file.
168 temp_dir.path().AppendASCII("script.js"))) {
169 *error = base::ASCIIToUTF16("Could not copy script file.");