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

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

Issue 934763003: Refactoring: de-couple Extensions from "script injection System" [render side]:3 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@decouple_brower_isolated_world_routingid_user_script_1
Patch Set: Created 5 years, 10 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(
11 const scoped_refptr<const Extension>& extension) 11 const scoped_refptr<const Extension>& extension)
12 : InjectionHost(HostID(HostID::EXTENSIONS, extension->id())), 12 : InjectionHost(HostID(HostID::EXTENSIONS, extension->id())),
13 extension_(extension) { 13 extension_(extension) {
14 } 14 }
15 15
16 ExtensionInjectionHost::~ExtensionInjectionHost() { 16 ExtensionInjectionHost::~ExtensionInjectionHost() {
17 } 17 }
18 18
19 const std::string& ExtensionInjectionHost::GetContentSecurityPolicy() const { 19 std::string ExtensionInjectionHost::GetContentSecurityPolicy() const {
20 return CSPInfo::GetContentSecurityPolicy(extension_.get()); 20 return CSPInfo::GetContentSecurityPolicy(extension_.get());
21 } 21 }
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 }
(...skipping 18 matching lines...) Expand all
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::IsGone() const {
59 return extension_.get() == nullptr;
60 }
61
58 } // namespace extensions 62 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698