OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/common/manifest_handlers/csp_info.h" | 5 #include "extensions/common/manifest_handlers/csp_info.h" |
6 #include "extensions/renderer/extension_injection_host.h" | 6 #include "extensions/renderer/extension_injection_host.h" |
7 | 7 |
8 namespace extensions { | 8 namespace extensions { |
9 | 9 |
10 ExtensionInjectionHost::ExtensionInjectionHost( | 10 ExtensionInjectionHost::ExtensionInjectionHost( |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 return extension_->permissions_data()->GetContentScriptAccess( | 48 return extension_->permissions_data()->GetContentScriptAccess( |
49 extension_.get(), | 49 extension_.get(), |
50 document_url, | 50 document_url, |
51 top_frame_url, | 51 top_frame_url, |
52 tab_id, | 52 tab_id, |
53 -1, // no process id | 53 -1, // no process id |
54 nullptr /* ignore error */); | 54 nullptr /* ignore error */); |
55 } | 55 } |
56 } | 56 } |
57 | 57 |
| 58 bool ExtensionInjectionHost::ShouldNotifyBrowserOfInjection() const { |
| 59 // We notify the browser of any injection if the extension has no withheld |
| 60 // permissions (i.e., the permissions weren't restricted), but would have |
| 61 // otherwise been affected by the scripts-require-action feature. |
| 62 return extension_->permissions_data()->withheld_permissions()->IsEmpty() && |
| 63 PermissionsData::ScriptsMayRequireActionForExtension( |
| 64 extension_.get(), |
| 65 extension_->permissions_data()->active_permissions().get()); |
| 66 } |
| 67 |
58 } // namespace extensions | 68 } // namespace extensions |
OLD | NEW |