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 16 matching lines...) Expand all Loading... |
27 : params_(new ExtensionMsg_ExecuteCode_Params(params)), | 27 : params_(new ExtensionMsg_ExecuteCode_Params(params)), |
28 url_(ScriptContext::GetDataSourceURLForFrame(web_frame)), | 28 url_(ScriptContext::GetDataSourceURLForFrame(web_frame)), |
29 render_view_(content::RenderView::FromWebView(web_frame->view())), | 29 render_view_(content::RenderView::FromWebView(web_frame->view())), |
30 results_(new base::ListValue()), | 30 results_(new base::ListValue()), |
31 finished_(false) { | 31 finished_(false) { |
32 } | 32 } |
33 | 33 |
34 ProgrammaticScriptInjector::~ProgrammaticScriptInjector() { | 34 ProgrammaticScriptInjector::~ProgrammaticScriptInjector() { |
35 } | 35 } |
36 | 36 |
| 37 bool ProgrammaticScriptInjector::is_declarative() const { |
| 38 return false; |
| 39 } |
| 40 |
37 UserScript::InjectionType ProgrammaticScriptInjector::script_type() | 41 UserScript::InjectionType ProgrammaticScriptInjector::script_type() |
38 const { | 42 const { |
39 return UserScript::PROGRAMMATIC_SCRIPT; | 43 return UserScript::PROGRAMMATIC_SCRIPT; |
40 } | 44 } |
41 | 45 |
42 bool ProgrammaticScriptInjector::ShouldExecuteInChildFrames() const { | 46 bool ProgrammaticScriptInjector::ShouldExecuteInChildFrames() const { |
43 return params_->all_frames; | 47 return params_->all_frames; |
44 } | 48 } |
45 | 49 |
46 bool ProgrammaticScriptInjector::ShouldExecuteInMainWorld() const { | 50 bool ProgrammaticScriptInjector::ShouldExecuteInMainWorld() const { |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 | 141 |
138 render_view_->Send(new ExtensionHostMsg_ExecuteCodeFinished( | 142 render_view_->Send(new ExtensionHostMsg_ExecuteCodeFinished( |
139 render_view_->GetRoutingID(), | 143 render_view_->GetRoutingID(), |
140 params_->request_id, | 144 params_->request_id, |
141 error, | 145 error, |
142 url_, | 146 url_, |
143 *results_)); | 147 *results_)); |
144 } | 148 } |
145 | 149 |
146 } // namespace extensions | 150 } // namespace extensions |
OLD | NEW |