OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/renderer_host/chrome_render_view_host_observer.h" | 5 #include "chrome/browser/renderer_host/chrome_render_view_host_observer.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "chrome/browser/dom_operation_notification_details.h" | 8 #include "chrome/browser/dom_operation_notification_details.h" |
9 #include "chrome/browser/extensions/extension_service.h" | 9 #include "chrome/browser/extensions/extension_service.h" |
10 #include "chrome/browser/net/predictor.h" | 10 #include "chrome/browser/net/predictor.h" |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 profile_->GetExtensionService()->SetInstalledAppForRenderer( | 107 profile_->GetExtensionService()->SetInstalledAppForRenderer( |
108 process->GetID(), extension); | 108 process->GetID(), extension); |
109 } | 109 } |
110 | 110 |
111 // Some extensions use chrome:// URLs. | 111 // Some extensions use chrome:// URLs. |
112 Extension::Type type = extension->GetType(); | 112 Extension::Type type = extension->GetType(); |
113 if (type == Extension::TYPE_EXTENSION || | 113 if (type == Extension::TYPE_EXTENSION || |
114 type == Extension::TYPE_PACKAGED_APP) { | 114 type == Extension::TYPE_PACKAGED_APP) { |
115 ChildProcessSecurityPolicy::GetInstance()->GrantScheme( | 115 ChildProcessSecurityPolicy::GetInstance()->GrantScheme( |
116 process->GetID(), chrome::kChromeUIScheme); | 116 process->GetID(), chrome::kChromeUIScheme); |
117 } | |
118 | 117 |
119 if (type == Extension::TYPE_EXTENSION && | 118 if (profile_->GetExtensionService()->extension_prefs()->AllowFileAccess( |
120 profile_->GetExtensionService()->extension_prefs()->AllowFileAccess( | |
121 extension->id())) { | 119 extension->id())) { |
122 ChildProcessSecurityPolicy::GetInstance()->GrantScheme( | 120 ChildProcessSecurityPolicy::GetInstance()->GrantScheme( |
123 process->GetID(), chrome::kFileScheme); | 121 process->GetID(), chrome::kFileScheme); |
| 122 } |
124 } | 123 } |
125 | 124 |
126 if (type == Extension::TYPE_EXTENSION || | 125 if (type == Extension::TYPE_EXTENSION || |
127 type == Extension::TYPE_USER_SCRIPT || | 126 type == Extension::TYPE_USER_SCRIPT || |
128 type == Extension::TYPE_PACKAGED_APP || | 127 type == Extension::TYPE_PACKAGED_APP || |
129 (type == Extension::TYPE_HOSTED_APP && | 128 (type == Extension::TYPE_HOSTED_APP && |
130 extension->location() == Extension::COMPONENT)) { | 129 extension->location() == Extension::COMPONENT)) { |
131 Send(new ExtensionMsg_ActivateExtension(extension->id())); | 130 Send(new ExtensionMsg_ActivateExtension(extension->id())); |
132 } | 131 } |
133 } | 132 } |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
174 content::Source<RenderViewHost>(render_view_host()), | 173 content::Source<RenderViewHost>(render_view_host()), |
175 content::Details<DomOperationNotificationDetails>(&details)); | 174 content::Details<DomOperationNotificationDetails>(&details)); |
176 } | 175 } |
177 | 176 |
178 void ChromeRenderViewHostObserver::OnFocusedEditableNodeTouched() { | 177 void ChromeRenderViewHostObserver::OnFocusedEditableNodeTouched() { |
179 content::NotificationService::current()->Notify( | 178 content::NotificationService::current()->Notify( |
180 chrome::NOTIFICATION_FOCUSED_EDITABLE_NODE_TOUCHED, | 179 chrome::NOTIFICATION_FOCUSED_EDITABLE_NODE_TOUCHED, |
181 content::Source<RenderViewHost>(render_view_host()), | 180 content::Source<RenderViewHost>(render_view_host()), |
182 content::NotificationService::NoDetails()); | 181 content::NotificationService::NoDetails()); |
183 } | 182 } |
OLD | NEW |