| Index: chrome/renderer/user_script_slave.cc
|
| diff --git a/chrome/renderer/user_script_slave.cc b/chrome/renderer/user_script_slave.cc
|
| index a06d856176bd4c614a186c7bcbb83d9ee11c7fcd..0c0574bde40bed01380bba124978ef54b0302524 100644
|
| --- a/chrome/renderer/user_script_slave.cc
|
| +++ b/chrome/renderer/user_script_slave.cc
|
| @@ -68,7 +68,8 @@ void UserScriptSlave::GetActiveExtensions(std::set<std::string>* extension_ids)
|
| }
|
| }
|
|
|
| -bool UserScriptSlave::UpdateScripts(base::SharedMemoryHandle shared_memory) {
|
| +bool UserScriptSlave::UpdateScripts(base::SharedMemoryHandle shared_memory,
|
| + bool only_inject_incognito) {
|
| scripts_.clear();
|
|
|
| // Create the shared memory object (read only).
|
| @@ -101,6 +102,13 @@ bool UserScriptSlave::UpdateScripts(base::SharedMemoryHandle shared_memory) {
|
| UserScript* script = scripts_.back();
|
| script->Unpickle(pickle, &iter);
|
|
|
| + if (only_inject_incognito && !script->is_incognito_enabled()) {
|
| + // This script shouldn't run in an incognito tab.
|
| + delete script;
|
| + scripts_.pop_back();
|
| + continue;
|
| + }
|
| +
|
| // Note that this is a pointer into shared memory. We don't own it. It gets
|
| // cleared up when the last renderer or browser process drops their
|
| // reference to the shared memory.
|
|
|