OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "extensions/browser/user_script_loader.h" | 5 #include "extensions/browser/user_script_loader.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/version.h" | 10 #include "base/version.h" |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
160 it != scripts.end(); | 160 it != scripts.end(); |
161 ++it) { | 161 ++it) { |
162 removed_scripts_.erase(*it); | 162 removed_scripts_.erase(*it); |
163 added_scripts_.insert(*it); | 163 added_scripts_.insert(*it); |
164 } | 164 } |
165 AttemptLoad(); | 165 AttemptLoad(); |
166 } | 166 } |
167 | 167 |
168 void UserScriptLoader::AddScripts(const std::set<UserScript>& scripts, | 168 void UserScriptLoader::AddScripts(const std::set<UserScript>& scripts, |
169 int render_process_id, | 169 int render_process_id, |
170 int render_view_id) { | 170 int render_view_id, |
| 171 bool is_incognito) { |
171 AddScripts(scripts); | 172 AddScripts(scripts); |
172 } | 173 } |
173 | 174 |
174 void UserScriptLoader::RemoveScripts(const std::set<UserScript>& scripts) { | 175 void UserScriptLoader::RemoveScripts(const std::set<UserScript>& scripts) { |
175 for (std::set<UserScript>::const_iterator it = scripts.begin(); | 176 for (std::set<UserScript>::const_iterator it = scripts.begin(); |
176 it != scripts.end(); | 177 it != scripts.end(); |
177 ++it) { | 178 ++it) { |
178 added_scripts_.erase(*it); | 179 added_scripts_.erase(*it); |
179 removed_scripts_.insert(*it); | 180 removed_scripts_.insert(*it); |
180 } | 181 } |
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
384 if (!shared_memory->ShareToProcess(handle, &handle_for_process)) | 385 if (!shared_memory->ShareToProcess(handle, &handle_for_process)) |
385 return; // This can legitimately fail if the renderer asserts at startup. | 386 return; // This can legitimately fail if the renderer asserts at startup. |
386 | 387 |
387 if (base::SharedMemory::IsHandleValid(handle_for_process)) { | 388 if (base::SharedMemory::IsHandleValid(handle_for_process)) { |
388 process->Send(new ExtensionMsg_UpdateUserScripts(handle_for_process, | 389 process->Send(new ExtensionMsg_UpdateUserScripts(handle_for_process, |
389 host_id(), changed_hosts)); | 390 host_id(), changed_hosts)); |
390 } | 391 } |
391 } | 392 } |
392 | 393 |
393 } // namespace extensions | 394 } // namespace extensions |
OLD | NEW |