Chromium Code Reviews| 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 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 145 | 145 |
| 146 // Reload the extension if it has crashed. | 146 // Reload the extension if it has crashed. |
| 147 // TODO(yoz): This reload doesn't happen synchronously for unpacked | 147 // TODO(yoz): This reload doesn't happen synchronously for unpacked |
| 148 // extensions. It seems to be fast enough, but there is a race. | 148 // extensions. It seems to be fast enough, but there is a race. |
| 149 // We should delay loading until the extension has reloaded. | 149 // We should delay loading until the extension has reloaded. |
| 150 if (service->GetTerminatedExtension(site.host())) | 150 if (service->GetTerminatedExtension(site.host())) |
| 151 service->ReloadExtension(site.host()); | 151 service->ReloadExtension(site.host()); |
| 152 | 152 |
| 153 // May be null if the extension doesn't exist, for example if somebody typos | 153 // May be null if the extension doesn't exist, for example if somebody typos |
| 154 // a chrome-extension:// URL. | 154 // a chrome-extension:// URL. |
| 155 return service->GetExtensionByURL(site); | 155 return service->extensions()->GetByURL(ExtensionURLInfo(site)); |
|
abarth-chromium
2011/12/07 23:51:44
Same here.
Yoyo Zhou
2011/12/08 20:52:17
I can't find any evidence that a SiteInstance migh
| |
| 156 } | 156 } |
| 157 | 157 |
| 158 void ChromeRenderViewHostObserver::RemoveRenderViewHostForExtensions( | 158 void ChromeRenderViewHostObserver::RemoveRenderViewHostForExtensions( |
| 159 RenderViewHost* rvh) { | 159 RenderViewHost* rvh) { |
| 160 ExtensionProcessManager* process_manager = | 160 ExtensionProcessManager* process_manager = |
| 161 profile_->GetExtensionProcessManager(); | 161 profile_->GetExtensionProcessManager(); |
| 162 if (process_manager) | 162 if (process_manager) |
| 163 process_manager->UnregisterRenderViewHost(rvh); | 163 process_manager->UnregisterRenderViewHost(rvh); |
| 164 } | 164 } |
| 165 | 165 |
| 166 void ChromeRenderViewHostObserver::OnDomOperationResponse( | 166 void ChromeRenderViewHostObserver::OnDomOperationResponse( |
| 167 const std::string& json_string, int automation_id) { | 167 const std::string& json_string, int automation_id) { |
| 168 DomOperationNotificationDetails details(json_string, automation_id); | 168 DomOperationNotificationDetails details(json_string, automation_id); |
| 169 content::NotificationService::current()->Notify( | 169 content::NotificationService::current()->Notify( |
| 170 chrome::NOTIFICATION_DOM_OPERATION_RESPONSE, | 170 chrome::NOTIFICATION_DOM_OPERATION_RESPONSE, |
| 171 content::Source<RenderViewHost>(render_view_host()), | 171 content::Source<RenderViewHost>(render_view_host()), |
| 172 content::Details<DomOperationNotificationDetails>(&details)); | 172 content::Details<DomOperationNotificationDetails>(&details)); |
| 173 } | 173 } |
| 174 | 174 |
| 175 void ChromeRenderViewHostObserver::OnFocusedEditableNodeTouched() { | 175 void ChromeRenderViewHostObserver::OnFocusedEditableNodeTouched() { |
| 176 content::NotificationService::current()->Notify( | 176 content::NotificationService::current()->Notify( |
| 177 chrome::NOTIFICATION_FOCUSED_EDITABLE_NODE_TOUCHED, | 177 chrome::NOTIFICATION_FOCUSED_EDITABLE_NODE_TOUCHED, |
| 178 content::Source<RenderViewHost>(render_view_host()), | 178 content::Source<RenderViewHost>(render_view_host()), |
| 179 content::NotificationService::NoDetails()); | 179 content::NotificationService::NoDetails()); |
| 180 } | 180 } |
| OLD | NEW |