| 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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 int tab_id, | 71 int tab_id, |
| 72 const GURL& top_url) const { | 72 const GURL& top_url) const { |
| 73 GURL effective_document_url = ScriptContext::GetEffectiveDocumentURL( | 73 GURL effective_document_url = ScriptContext::GetEffectiveDocumentURL( |
| 74 frame, frame->document().url(), params_->match_about_blank); | 74 frame, frame->document().url(), params_->match_about_blank); |
| 75 if (params_->is_web_view) { | 75 if (params_->is_web_view) { |
| 76 return effective_document_url == params_->webview_src | 76 return effective_document_url == params_->webview_src |
| 77 ? PermissionsData::ACCESS_ALLOWED | 77 ? PermissionsData::ACCESS_ALLOWED |
| 78 : PermissionsData::ACCESS_DENIED; | 78 : PermissionsData::ACCESS_DENIED; |
| 79 } | 79 } |
| 80 | 80 |
| 81 return extension->permissions_data()->GetPageAccess(extension, | 81 return extension->permissions_data()->GetPageAccess( |
| 82 effective_document_url, | 82 extension, |
| 83 top_url, | 83 effective_document_url, |
| 84 tab_id, | 84 top_url, |
| 85 -1, // no process ID. | 85 tab_id, |
| 86 NULL /* ignore error */); | 86 -1, // no process ID. |
| 87 nullptr /* ignore error */); |
| 87 } | 88 } |
| 88 | 89 |
| 89 std::vector<blink::WebScriptSource> ProgrammaticScriptInjector::GetJsSources( | 90 std::vector<blink::WebScriptSource> ProgrammaticScriptInjector::GetJsSources( |
| 90 UserScript::RunLocation run_location) const { | 91 UserScript::RunLocation run_location) const { |
| 91 DCHECK_EQ(GetRunLocation(), run_location); | 92 DCHECK_EQ(GetRunLocation(), run_location); |
| 92 DCHECK(params_->is_javascript); | 93 DCHECK(params_->is_javascript); |
| 93 | 94 |
| 94 return std::vector<blink::WebScriptSource>( | 95 return std::vector<blink::WebScriptSource>( |
| 95 1, | 96 1, |
| 96 blink::WebScriptSource( | 97 blink::WebScriptSource( |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 | 138 |
| 138 render_view_->Send(new ExtensionHostMsg_ExecuteCodeFinished( | 139 render_view_->Send(new ExtensionHostMsg_ExecuteCodeFinished( |
| 139 render_view_->GetRoutingID(), | 140 render_view_->GetRoutingID(), |
| 140 params_->request_id, | 141 params_->request_id, |
| 141 error, | 142 error, |
| 142 url_, | 143 url_, |
| 143 *results_)); | 144 *results_)); |
| 144 } | 145 } |
| 145 | 146 |
| 146 } // namespace extensions | 147 } // namespace extensions |
| OLD | NEW |