OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "chrome/browser/extensions/extension_web_contents_observer.h" | 5 #include "chrome/browser/extensions/extension_web_contents_observer.h" |
6 | 6 |
7 #include "chrome/browser/extensions/api/messaging/message_service.h" | 7 #include "chrome/browser/extensions/api/messaging/message_service.h" |
8 #include "chrome/browser/extensions/extension_service.h" | 8 #include "chrome/browser/extensions/extension_service.h" |
9 #include "chrome/browser/extensions/extension_system.h" | 9 #include "chrome/browser/extensions/extension_system.h" |
10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 content::ChildProcessSecurityPolicy::GetInstance()->GrantScheme( | 55 content::ChildProcessSecurityPolicy::GetInstance()->GrantScheme( |
56 process->GetID(), chrome::kChromeUIScheme); | 56 process->GetID(), chrome::kChromeUIScheme); |
57 } | 57 } |
58 | 58 |
59 // Some extensions use file:// URLs. | 59 // Some extensions use file:// URLs. |
60 if (type == Manifest::TYPE_EXTENSION || | 60 if (type == Manifest::TYPE_EXTENSION || |
61 type == Manifest::TYPE_LEGACY_PACKAGED_APP) { | 61 type == Manifest::TYPE_LEGACY_PACKAGED_APP) { |
62 if (ExtensionSystem::Get(profile_)->extension_service()-> | 62 if (ExtensionSystem::Get(profile_)->extension_service()-> |
63 extension_prefs()->AllowFileAccess(extension->id())) { | 63 extension_prefs()->AllowFileAccess(extension->id())) { |
64 content::ChildProcessSecurityPolicy::GetInstance()->GrantScheme( | 64 content::ChildProcessSecurityPolicy::GetInstance()->GrantScheme( |
65 process->GetID(), chrome::kFileScheme); | 65 process->GetID(), content::kFileScheme); |
66 } | 66 } |
67 } | 67 } |
68 | 68 |
69 switch (type) { | 69 switch (type) { |
70 case Manifest::TYPE_EXTENSION: | 70 case Manifest::TYPE_EXTENSION: |
71 case Manifest::TYPE_USER_SCRIPT: | 71 case Manifest::TYPE_USER_SCRIPT: |
72 case Manifest::TYPE_HOSTED_APP: | 72 case Manifest::TYPE_HOSTED_APP: |
73 case Manifest::TYPE_LEGACY_PACKAGED_APP: | 73 case Manifest::TYPE_LEGACY_PACKAGED_APP: |
74 case Manifest::TYPE_PLATFORM_APP: | 74 case Manifest::TYPE_PLATFORM_APP: |
75 // Always send a Loaded message before ActivateExtension so that | 75 // Always send a Loaded message before ActivateExtension so that |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 // We should delay loading until the extension has reloaded. | 129 // We should delay loading until the extension has reloaded. |
130 if (service->GetTerminatedExtension(site.host())) | 130 if (service->GetTerminatedExtension(site.host())) |
131 service->ReloadExtension(site.host()); | 131 service->ReloadExtension(site.host()); |
132 | 132 |
133 // May be null if the extension doesn't exist, for example if somebody typos | 133 // May be null if the extension doesn't exist, for example if somebody typos |
134 // a chrome-extension:// URL. | 134 // a chrome-extension:// URL. |
135 return service->extensions()->GetByID(site.host()); | 135 return service->extensions()->GetByID(site.host()); |
136 } | 136 } |
137 | 137 |
138 } // namespace extensions | 138 } // namespace extensions |
OLD | NEW |