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 <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/values.h" | 9 #include "base/values.h" |
10 #include "content/public/renderer/render_view.h" | 10 #include "content/public/renderer/render_view.h" |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 } | 99 } |
100 | 100 |
101 std::vector<std::string> ProgrammaticScriptInjector::GetCssSources( | 101 std::vector<std::string> ProgrammaticScriptInjector::GetCssSources( |
102 UserScript::RunLocation run_location) const { | 102 UserScript::RunLocation run_location) const { |
103 DCHECK_EQ(GetRunLocation(), run_location); | 103 DCHECK_EQ(GetRunLocation(), run_location); |
104 DCHECK(!params_->is_javascript); | 104 DCHECK(!params_->is_javascript); |
105 | 105 |
106 return std::vector<std::string>(1, params_->code); | 106 return std::vector<std::string>(1, params_->code); |
107 } | 107 } |
108 | 108 |
| 109 void ProgrammaticScriptInjector::GetRunInfo( |
| 110 ScriptsRunInfo* scripts_run_info, |
| 111 UserScript::RunLocation run_location) const { |
| 112 } |
| 113 |
109 void ProgrammaticScriptInjector::OnInjectionComplete( | 114 void ProgrammaticScriptInjector::OnInjectionComplete( |
110 scoped_ptr<base::ListValue> execution_results, | 115 scoped_ptr<base::ListValue> execution_results, |
111 ScriptsRunInfo* scripts_run_info, | |
112 UserScript::RunLocation run_location) { | 116 UserScript::RunLocation run_location) { |
113 results_ = execution_results.Pass(); | 117 results_ = execution_results.Pass(); |
114 Finish(std::string()); | 118 Finish(std::string()); |
115 } | 119 } |
116 | 120 |
117 void ProgrammaticScriptInjector::OnWillNotInject(InjectFailureReason reason) { | 121 void ProgrammaticScriptInjector::OnWillNotInject(InjectFailureReason reason) { |
118 std::string error; | 122 std::string error; |
119 switch (reason) { | 123 switch (reason) { |
120 case NOT_ALLOWED: | 124 case NOT_ALLOWED: |
121 error = ErrorUtils::FormatErrorMessage(manifest_errors::kCannotAccessPage, | 125 error = ErrorUtils::FormatErrorMessage(manifest_errors::kCannotAccessPage, |
(...skipping 16 matching lines...) Expand all Loading... |
138 | 142 |
139 render_view_->Send(new ExtensionHostMsg_ExecuteCodeFinished( | 143 render_view_->Send(new ExtensionHostMsg_ExecuteCodeFinished( |
140 render_view_->GetRoutingID(), | 144 render_view_->GetRoutingID(), |
141 params_->request_id, | 145 params_->request_id, |
142 error, | 146 error, |
143 url_, | 147 url_, |
144 *results_)); | 148 *results_)); |
145 } | 149 } |
146 | 150 |
147 } // namespace extensions | 151 } // namespace extensions |
OLD | NEW |