Chromium Code Reviews| Index: extensions/renderer/web_ui_injection_host.cc |
| diff --git a/extensions/renderer/web_ui_injection_host.cc b/extensions/renderer/web_ui_injection_host.cc |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..334358a03c1e027c29682401cb13fb4a9612750c |
| --- /dev/null |
| +++ b/extensions/renderer/web_ui_injection_host.cc |
| @@ -0,0 +1,41 @@ |
| +// Copyright 2015 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#include "extensions/renderer/web_ui_injection_host.h" |
| + |
| +WebUIInjectionHost::WebUIInjectionHost(const HostID& host_id) |
| + : InjectionHost(host_id), |
| + url_(host_id.id()) { |
| +} |
| + |
| +WebUIInjectionHost::~WebUIInjectionHost() { |
| +} |
| + |
| + |
| +std::string WebUIInjectionHost::GetContentSecurityPolicy() const { |
| + return std::string(); |
| +} |
| + |
| +const GURL& WebUIInjectionHost::url() const { |
| + return url_; |
| +} |
| + |
| +const std::string& WebUIInjectionHost::name() const { |
| + return id().id(); |
| +} |
| + |
| +extensions::PermissionsData::AccessType WebUIInjectionHost::CanExecuteOnFrame( |
| + const GURL& document_url, |
| + const GURL& top_frame_url, |
| + int tab_id, |
| + bool is_declarative) const { |
| + // Content scripts are allowed to inject on webviews created by WebUI. |
| + return extensions::PermissionsData::AccessType::ACCESS_ALLOWED; |
|
Devlin
2015/02/23 17:27:39
In theory, shouldn't the document_url or top_frame
Xi Han
2015/02/24 16:39:50
Hmmm, they don't match. The |url_| is the url of t
|
| +} |
| + |
| +bool WebUIInjectionHost::ShouldNotifyBrowserOfInjection() const { |
| + // We don't notify browser of any injection made from WebUI, since the |
| + // decision for injection is made in the render. |
| + return false; |
| +} |