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 16 matching lines...) Expand all Loading... |
27 | 27 |
28 ProgrammaticScriptInjector::ProgrammaticScriptInjector( | 28 ProgrammaticScriptInjector::ProgrammaticScriptInjector( |
29 const ExtensionMsg_ExecuteCode_Params& params, | 29 const ExtensionMsg_ExecuteCode_Params& params, |
30 content::RenderFrame* render_frame) | 30 content::RenderFrame* render_frame) |
31 : params_(new ExtensionMsg_ExecuteCode_Params(params)), | 31 : params_(new ExtensionMsg_ExecuteCode_Params(params)), |
32 url_( | 32 url_( |
33 ScriptContext::GetDataSourceURLForFrame(render_frame->GetWebFrame())), | 33 ScriptContext::GetDataSourceURLForFrame(render_frame->GetWebFrame())), |
34 finished_(false) { | 34 finished_(false) { |
35 if (url_.SchemeIs(url::kAboutScheme)) { | 35 if (url_.SchemeIs(url::kAboutScheme)) { |
36 origin_for_about_error_ = | 36 origin_for_about_error_ = |
37 render_frame->GetWebFrame()->securityOrigin().toString().utf8(); | 37 render_frame->GetWebFrame()->getSecurityOrigin().toString().utf8(); |
38 } | 38 } |
39 } | 39 } |
40 | 40 |
41 ProgrammaticScriptInjector::~ProgrammaticScriptInjector() { | 41 ProgrammaticScriptInjector::~ProgrammaticScriptInjector() { |
42 } | 42 } |
43 | 43 |
44 UserScript::InjectionType ProgrammaticScriptInjector::script_type() | 44 UserScript::InjectionType ProgrammaticScriptInjector::script_type() |
45 const { | 45 const { |
46 return UserScript::PROGRAMMATIC_SCRIPT; | 46 return UserScript::PROGRAMMATIC_SCRIPT; |
47 } | 47 } |
(...skipping 128 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 |