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/renderer/user_script_set.h" | 5 #include "extensions/renderer/user_script_set.h" |
6 | 6 |
7 #include "content/public/common/url_constants.h" | 7 #include "content/public/common/url_constants.h" |
8 #include "content/public/renderer/render_thread.h" | 8 #include "content/public/renderer/render_thread.h" |
9 #include "extensions/common/extension.h" | 9 #include "extensions/common/extension.h" |
10 #include "extensions/common/extension_set.h" | 10 #include "extensions/common/extension_set.h" |
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
204 } | 204 } |
205 | 205 |
206 bool inject_css = !script->css_scripts().empty() && | 206 bool inject_css = !script->css_scripts().empty() && |
207 run_location == UserScript::DOCUMENT_START; | 207 run_location == UserScript::DOCUMENT_START; |
208 bool inject_js = | 208 bool inject_js = |
209 !script->js_scripts().empty() && script->run_location() == run_location; | 209 !script->js_scripts().empty() && script->run_location() == run_location; |
210 if (inject_css || inject_js) { | 210 if (inject_css || inject_js) { |
211 injection.reset(new ScriptInjection( | 211 injection.reset(new ScriptInjection( |
212 injector.Pass(), | 212 injector.Pass(), |
213 web_frame->toWebLocalFrame(), | 213 web_frame->toWebLocalFrame(), |
214 extension->id(), | 214 HostID(HostID::EXTENSIONS, extension->id()), |
| 215 // TODO(hanxi): store and obtain the instance id from the UserScript. |
| 216 Host::kDefaultInstanceId, |
215 run_location, | 217 run_location, |
216 tab_id)); | 218 tab_id)); |
217 } | 219 } |
218 return injection.Pass(); | 220 return injection.Pass(); |
219 } | 221 } |
220 | 222 |
221 } // namespace extensions | 223 } // namespace extensions |
OLD | NEW |