| 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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 if (params_->is_web_view) { | 75 if (params_->is_web_view) { |
| 76 if (frame->parent()) { | 76 if (frame->parent()) { |
| 77 // This is a subframe inside <webview>, so allow it. | 77 // This is a subframe inside <webview>, so allow it. |
| 78 return PermissionsData::ACCESS_ALLOWED; | 78 return PermissionsData::ACCESS_ALLOWED; |
| 79 } | 79 } |
| 80 | 80 |
| 81 return effective_document_url == params_->webview_src | 81 return effective_document_url == params_->webview_src |
| 82 ? PermissionsData::ACCESS_ALLOWED | 82 ? PermissionsData::ACCESS_ALLOWED |
| 83 : PermissionsData::ACCESS_DENIED; | 83 : PermissionsData::ACCESS_DENIED; |
| 84 } | 84 } |
| 85 DCHECK(injection_host->id().type() == HostID::EXTENSIONS); |
| 85 | 86 |
| 86 return injection_host->CanExecuteOnFrame( | 87 return injection_host->CanExecuteOnFrame( |
| 87 effective_document_url, top_url, tab_id, true /* is_declarative */); | 88 effective_document_url, top_url, tab_id, true /* is_declarative */); |
| 88 } | 89 } |
| 89 | 90 |
| 90 std::vector<blink::WebScriptSource> ProgrammaticScriptInjector::GetJsSources( | 91 std::vector<blink::WebScriptSource> ProgrammaticScriptInjector::GetJsSources( |
| 91 UserScript::RunLocation run_location) const { | 92 UserScript::RunLocation run_location) const { |
| 92 DCHECK_EQ(GetRunLocation(), run_location); | 93 DCHECK_EQ(GetRunLocation(), run_location); |
| 93 DCHECK(params_->is_javascript); | 94 DCHECK(params_->is_javascript); |
| 94 | 95 |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 | 139 |
| 139 render_view_->Send(new ExtensionHostMsg_ExecuteCodeFinished( | 140 render_view_->Send(new ExtensionHostMsg_ExecuteCodeFinished( |
| 140 render_view_->GetRoutingID(), | 141 render_view_->GetRoutingID(), |
| 141 params_->request_id, | 142 params_->request_id, |
| 142 error, | 143 error, |
| 143 url_, | 144 url_, |
| 144 *results_)); | 145 *results_)); |
| 145 } | 146 } |
| 146 | 147 |
| 147 } // namespace extensions | 148 } // namespace extensions |
| OLD | NEW |