| 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 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 // packaged apps, and hosted component apps use extension bindings. | 90 // packaged apps, and hosted component apps use extension bindings. |
| 91 Extension::Type type = extension->GetType(); | 91 Extension::Type type = extension->GetType(); |
| 92 if (type == Extension::TYPE_EXTENSION || | 92 if (type == Extension::TYPE_EXTENSION || |
| 93 type == Extension::TYPE_USER_SCRIPT || | 93 type == Extension::TYPE_USER_SCRIPT || |
| 94 type == Extension::TYPE_PACKAGED_APP || | 94 type == Extension::TYPE_PACKAGED_APP || |
| 95 (type == Extension::TYPE_HOSTED_APP && | 95 (type == Extension::TYPE_HOSTED_APP && |
| 96 extension->location() == Extension::COMPONENT)) { | 96 extension->location() == Extension::COMPONENT)) { |
| 97 render_view_host()->AllowBindings(BindingsPolicy::EXTENSION); | 97 render_view_host()->AllowBindings(BindingsPolicy::EXTENSION); |
| 98 ChildProcessSecurityPolicy::GetInstance()->GrantExtensionBindings( | 98 ChildProcessSecurityPolicy::GetInstance()->GrantExtensionBindings( |
| 99 render_view_host()->process()->id()); | 99 render_view_host()->process()->id()); |
| 100 process_manager->RegisterProcessHost(render_view_host()->process()->id()); |
| 100 } | 101 } |
| 101 } | 102 } |
| 102 | 103 |
| 103 void ChromeRenderViewHostObserver::InitRenderViewForExtensions() { | 104 void ChromeRenderViewHostObserver::InitRenderViewForExtensions() { |
| 104 const Extension* extension = GetExtension(); | 105 const Extension* extension = GetExtension(); |
| 105 if (!extension) | 106 if (!extension) |
| 106 return; | 107 return; |
| 107 | 108 |
| 108 SiteInstance* site_instance = render_view_host()->site_instance(); | 109 SiteInstance* site_instance = render_view_host()->site_instance(); |
| 109 Profile* profile = Profile::FromBrowserContext( | 110 Profile* profile = Profile::FromBrowserContext( |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 } | 159 } |
| 159 | 160 |
| 160 void ChromeRenderViewHostObserver::OnDomOperationResponse( | 161 void ChromeRenderViewHostObserver::OnDomOperationResponse( |
| 161 const std::string& json_string, int automation_id) { | 162 const std::string& json_string, int automation_id) { |
| 162 DomOperationNotificationDetails details(json_string, automation_id); | 163 DomOperationNotificationDetails details(json_string, automation_id); |
| 163 NotificationService::current()->Notify( | 164 NotificationService::current()->Notify( |
| 164 chrome::NOTIFICATION_DOM_OPERATION_RESPONSE, | 165 chrome::NOTIFICATION_DOM_OPERATION_RESPONSE, |
| 165 Source<RenderViewHost>(render_view_host()), | 166 Source<RenderViewHost>(render_view_host()), |
| 166 Details<DomOperationNotificationDetails>(&details)); | 167 Details<DomOperationNotificationDetails>(&details)); |
| 167 } | 168 } |
| OLD | NEW |