| 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/programmatic_script_injector.h" | 5 #include "extensions/renderer/programmatic_script_injector.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/values.h" | 10 #include "base/values.h" |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 UserScript::RunLocation run_location) const { | 97 UserScript::RunLocation run_location) const { |
| 98 DCHECK_EQ(GetRunLocation(), run_location); | 98 DCHECK_EQ(GetRunLocation(), run_location); |
| 99 DCHECK(params_->is_javascript); | 99 DCHECK(params_->is_javascript); |
| 100 | 100 |
| 101 return std::vector<blink::WebScriptSource>( | 101 return std::vector<blink::WebScriptSource>( |
| 102 1, | 102 1, |
| 103 blink::WebScriptSource( | 103 blink::WebScriptSource( |
| 104 blink::WebString::fromUTF8(params_->code), params_->file_url)); | 104 blink::WebString::fromUTF8(params_->code), params_->file_url)); |
| 105 } | 105 } |
| 106 | 106 |
| 107 std::vector<std::string> ProgrammaticScriptInjector::GetCssSources( | 107 std::vector<blink::WebString> ProgrammaticScriptInjector::GetCssSources( |
| 108 UserScript::RunLocation run_location) const { | 108 UserScript::RunLocation run_location) const { |
| 109 DCHECK_EQ(GetRunLocation(), run_location); | 109 DCHECK_EQ(GetRunLocation(), run_location); |
| 110 DCHECK(!params_->is_javascript); | 110 DCHECK(!params_->is_javascript); |
| 111 | 111 |
| 112 return std::vector<std::string>(1, params_->code); | 112 return std::vector<blink::WebString>( |
| 113 1, blink::WebString::fromUTF8(params_->code)); |
| 113 } | 114 } |
| 114 | 115 |
| 115 void ProgrammaticScriptInjector::GetRunInfo( | 116 void ProgrammaticScriptInjector::GetRunInfo( |
| 116 ScriptsRunInfo* scripts_run_info, | 117 ScriptsRunInfo* scripts_run_info, |
| 117 UserScript::RunLocation run_location) const { | 118 UserScript::RunLocation run_location) const { |
| 118 } | 119 } |
| 119 | 120 |
| 120 void ProgrammaticScriptInjector::OnInjectionComplete( | 121 void ProgrammaticScriptInjector::OnInjectionComplete( |
| 121 std::unique_ptr<base::Value> execution_result, | 122 std::unique_ptr<base::Value> execution_result, |
| 122 UserScript::RunLocation run_location, | 123 UserScript::RunLocation run_location, |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 176 // frame deletions so nothing is left hanging). | 177 // frame deletions so nothing is left hanging). |
| 177 if (render_frame) { | 178 if (render_frame) { |
| 178 render_frame->Send( | 179 render_frame->Send( |
| 179 new ExtensionHostMsg_ExecuteCodeFinished( | 180 new ExtensionHostMsg_ExecuteCodeFinished( |
| 180 render_frame->GetRoutingID(), params_->request_id, | 181 render_frame->GetRoutingID(), params_->request_id, |
| 181 error, url_, results_)); | 182 error, url_, results_)); |
| 182 } | 183 } |
| 183 } | 184 } |
| 184 | 185 |
| 185 } // namespace extensions | 186 } // namespace extensions |
| OLD | NEW |