Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(75)

Side by Side Diff: extensions/renderer/extension_injection_host.cc

Issue 906493004: Refactoring: de-couple Extensions from "script injection System" [render side]:2 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@decouple_brower_isolated_world_1
Patch Set: Devlin's comments and rebase. Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 11 matching lines...) Expand all
22 22
23 const GURL& ExtensionInjectionHost::url() const { 23 const GURL& ExtensionInjectionHost::url() const {
24 return extension_->url(); 24 return extension_->url();
25 } 25 }
26 26
27 const std::string& ExtensionInjectionHost::name() const { 27 const std::string& ExtensionInjectionHost::name() const {
28 return extension_->name(); 28 return extension_->name();
29 } 29 }
30 30
31 PermissionsData::AccessType ExtensionInjectionHost::CanExecuteOnFrame( 31 PermissionsData::AccessType ExtensionInjectionHost::CanExecuteOnFrame(
32 const GURL& document_url, 32 const GURL& document_url,
33 const GURL& top_frame_url, 33 const GURL& top_frame_url,
34 int tab_id, 34 int tab_id,
35 bool is_declarative) const { 35 bool is_declarative) const {
36 // Declarative user scripts use "page access" (from "permissions" section in 36 // Declarative user scripts use "page access" (from "permissions" section in
37 // manifest) whereas non-declarative user scripts use custom 37 // manifest) whereas non-declarative user scripts use custom
38 // "content script access" logic. 38 // "content script access" logic.
39 if (is_declarative) { 39 if (is_declarative) {
40 return extension_->permissions_data()->GetPageAccess( 40 return extension_->permissions_data()->GetPageAccess(
41 extension_.get(), 41 extension_.get(),
42 document_url, 42 document_url,
43 top_frame_url, 43 top_frame_url,
44 tab_id, 44 tab_id,
45 -1, // no process id 45 -1, // no process id
(...skipping 13 matching lines...) Expand all
59 // We notify the browser of any injection if the extension has no withheld 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 60 // permissions (i.e., the permissions weren't restricted), but would have
61 // otherwise been affected by the scripts-require-action feature. 61 // otherwise been affected by the scripts-require-action feature.
62 return extension_->permissions_data()->withheld_permissions()->IsEmpty() && 62 return extension_->permissions_data()->withheld_permissions()->IsEmpty() &&
63 PermissionsData::ScriptsMayRequireActionForExtension( 63 PermissionsData::ScriptsMayRequireActionForExtension(
64 extension_.get(), 64 extension_.get(),
65 extension_->permissions_data()->active_permissions().get()); 65 extension_->permissions_data()->active_permissions().get());
66 } 66 }
67 67
68 } // namespace extensions 68 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698