| 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 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 if (profile_->GetExtensionService()->extension_prefs()->AllowFileAccess( | 115 if (profile_->GetExtensionService()->extension_prefs()->AllowFileAccess( |
| 116 extension->id())) { | 116 extension->id())) { |
| 117 ChildProcessSecurityPolicy::GetInstance()->GrantScheme( | 117 ChildProcessSecurityPolicy::GetInstance()->GrantScheme( |
| 118 process->GetID(), chrome::kFileScheme); | 118 process->GetID(), chrome::kFileScheme); |
| 119 } | 119 } |
| 120 } | 120 } |
| 121 | 121 |
| 122 if (type == Extension::TYPE_EXTENSION || | 122 if (type == Extension::TYPE_EXTENSION || |
| 123 type == Extension::TYPE_USER_SCRIPT || | 123 type == Extension::TYPE_USER_SCRIPT || |
| 124 type == Extension::TYPE_PACKAGED_APP || | 124 type == Extension::TYPE_PACKAGED_APP || |
| 125 type == Extension::TYPE_PLATFORM_APP || |
| 125 (type == Extension::TYPE_HOSTED_APP && | 126 (type == Extension::TYPE_HOSTED_APP && |
| 126 extension->location() == Extension::COMPONENT)) { | 127 extension->location() == Extension::COMPONENT)) { |
| 127 Send(new ExtensionMsg_ActivateExtension(extension->id())); | 128 Send(new ExtensionMsg_ActivateExtension(extension->id())); |
| 128 } | 129 } |
| 129 } | 130 } |
| 130 | 131 |
| 131 const Extension* ChromeRenderViewHostObserver::GetExtension() { | 132 const Extension* ChromeRenderViewHostObserver::GetExtension() { |
| 132 // Note that due to ChromeContentBrowserClient::GetEffectiveURL(), hosted apps | 133 // Note that due to ChromeContentBrowserClient::GetEffectiveURL(), hosted apps |
| 133 // (excluding bookmark apps) will have a chrome-extension:// URL for their | 134 // (excluding bookmark apps) will have a chrome-extension:// URL for their |
| 134 // site, so we can ignore that wrinkle here. | 135 // site, so we can ignore that wrinkle here. |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 170 content::Source<RenderViewHost>(render_view_host()), | 171 content::Source<RenderViewHost>(render_view_host()), |
| 171 content::Details<DomOperationNotificationDetails>(&details)); | 172 content::Details<DomOperationNotificationDetails>(&details)); |
| 172 } | 173 } |
| 173 | 174 |
| 174 void ChromeRenderViewHostObserver::OnFocusedEditableNodeTouched() { | 175 void ChromeRenderViewHostObserver::OnFocusedEditableNodeTouched() { |
| 175 content::NotificationService::current()->Notify( | 176 content::NotificationService::current()->Notify( |
| 176 chrome::NOTIFICATION_FOCUSED_EDITABLE_NODE_TOUCHED, | 177 chrome::NOTIFICATION_FOCUSED_EDITABLE_NODE_TOUCHED, |
| 177 content::Source<RenderViewHost>(render_view_host()), | 178 content::Source<RenderViewHost>(render_view_host()), |
| 178 content::NotificationService::NoDetails()); | 179 content::NotificationService::NoDetails()); |
| 179 } | 180 } |
| OLD | NEW |