| 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/script_injection.h" | 5 #include "extensions/renderer/script_injection.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
| (...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 305 // asynchronously, and we should run it. | 305 // asynchronously, and we should run it. |
| 306 if (!async_completion_callback_.is_null()) { | 306 if (!async_completion_callback_.is_null()) { |
| 307 injector_->OnInjectionComplete(std::move(execution_result_), run_location_, | 307 injector_->OnInjectionComplete(std::move(execution_result_), run_location_, |
| 308 render_frame_); | 308 render_frame_); |
| 309 // Warning: this object can be destroyed after this line! | 309 // Warning: this object can be destroyed after this line! |
| 310 async_completion_callback_.Run(this); | 310 async_completion_callback_.Run(this); |
| 311 } | 311 } |
| 312 } | 312 } |
| 313 | 313 |
| 314 void ScriptInjection::InjectCss() { | 314 void ScriptInjection::InjectCss() { |
| 315 std::vector<std::string> css_sources = | 315 std::vector<blink::WebString> css_sources = |
| 316 injector_->GetCssSources(run_location_); | 316 injector_->GetCssSources(run_location_); |
| 317 blink::WebLocalFrame* web_frame = render_frame_->GetWebFrame(); | 317 blink::WebLocalFrame* web_frame = render_frame_->GetWebFrame(); |
| 318 for (const std::string& css : css_sources) | 318 for (const blink::WebString& css : css_sources) |
| 319 web_frame->document().insertStyleSheet(blink::WebString::fromUTF8(css)); | 319 web_frame->document().insertStyleSheet(css); |
| 320 } | 320 } |
| 321 | 321 |
| 322 } // namespace extensions | 322 } // namespace extensions |
| OLD | NEW |