| 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 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 | 111 |
| 112 return std::vector<std::string>(1, params_->code); | 112 return std::vector<std::string>(1, params_->code); |
| 113 } | 113 } |
| 114 | 114 |
| 115 void ProgrammaticScriptInjector::GetRunInfo( | 115 void ProgrammaticScriptInjector::GetRunInfo( |
| 116 ScriptsRunInfo* scripts_run_info, | 116 ScriptsRunInfo* scripts_run_info, |
| 117 UserScript::RunLocation run_location) const { | 117 UserScript::RunLocation run_location) const { |
| 118 } | 118 } |
| 119 | 119 |
| 120 void ProgrammaticScriptInjector::OnInjectionComplete( | 120 void ProgrammaticScriptInjector::OnInjectionComplete( |
| 121 scoped_ptr<base::Value> execution_result, | 121 std::unique_ptr<base::Value> execution_result, |
| 122 UserScript::RunLocation run_location, | 122 UserScript::RunLocation run_location, |
| 123 content::RenderFrame* render_frame) { | 123 content::RenderFrame* render_frame) { |
| 124 DCHECK(results_.empty()); | 124 DCHECK(results_.empty()); |
| 125 if (execution_result) | 125 if (execution_result) |
| 126 results_.Append(std::move(execution_result)); | 126 results_.Append(std::move(execution_result)); |
| 127 Finish(std::string(), render_frame); | 127 Finish(std::string(), render_frame); |
| 128 } | 128 } |
| 129 | 129 |
| 130 void ProgrammaticScriptInjector::OnWillNotInject( | 130 void ProgrammaticScriptInjector::OnWillNotInject( |
| 131 InjectFailureReason reason, | 131 InjectFailureReason reason, |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 176 // frame deletions so nothing is left hanging). | 176 // frame deletions so nothing is left hanging). |
| 177 if (render_frame) { | 177 if (render_frame) { |
| 178 render_frame->Send( | 178 render_frame->Send( |
| 179 new ExtensionHostMsg_ExecuteCodeFinished( | 179 new ExtensionHostMsg_ExecuteCodeFinished( |
| 180 render_frame->GetRoutingID(), params_->request_id, | 180 render_frame->GetRoutingID(), params_->request_id, |
| 181 error, url_, results_)); | 181 error, url_, results_)); |
| 182 } | 182 } |
| 183 } | 183 } |
| 184 | 184 |
| 185 } // namespace extensions | 185 } // namespace extensions |
| OLD | NEW |