| 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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 if (!extension) | 65 if (!extension) |
| 66 return; | 66 return; |
| 67 | 67 |
| 68 SiteInstance* site_instance = render_view_host()->site_instance(); | 68 SiteInstance* site_instance = render_view_host()->site_instance(); |
| 69 Profile* profile = Profile::FromBrowserContext( | 69 Profile* profile = Profile::FromBrowserContext( |
| 70 site_instance->browsing_instance()->browser_context()); | 70 site_instance->browsing_instance()->browser_context()); |
| 71 ExtensionProcessManager* process_manager = | 71 ExtensionProcessManager* process_manager = |
| 72 profile->GetExtensionProcessManager(); | 72 profile->GetExtensionProcessManager(); |
| 73 CHECK(process_manager); | 73 CHECK(process_manager); |
| 74 | 74 |
| 75 site_instance->GetProcess()->mark_is_extension_process(); | |
| 76 | |
| 77 // Register the association between extension and SiteInstance with | 75 // Register the association between extension and SiteInstance with |
| 78 // ExtensionProcessManager. | 76 // ExtensionProcessManager. |
| 79 // TODO(creis): Use this to replace SetInstalledAppForRenderer. | 77 // TODO(creis): Use this to replace SetInstalledAppForRenderer. |
| 80 process_manager->RegisterExtensionSiteInstance(site_instance, | 78 process_manager->RegisterExtensionSiteInstance(site_instance, |
| 81 extension); | 79 extension); |
| 82 | 80 |
| 83 if (extension->is_app()) { | 81 if (extension->is_app()) { |
| 84 // Record which, if any, installed app is associated with this process. | 82 // Record which, if any, installed app is associated with this process. |
| 85 // TODO(aa): Totally lame to store this state in a global map in extension | 83 // TODO(aa): Totally lame to store this state in a global map in extension |
| 86 // service. Can we get it from EPM instead? | 84 // service. Can we get it from EPM instead? |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 154 Source<RenderViewHost>(render_view_host()), | 152 Source<RenderViewHost>(render_view_host()), |
| 155 Details<DomOperationNotificationDetails>(&details)); | 153 Details<DomOperationNotificationDetails>(&details)); |
| 156 } | 154 } |
| 157 | 155 |
| 158 void ChromeRenderViewHostObserver::OnFocusedEditableNodeTouched() { | 156 void ChromeRenderViewHostObserver::OnFocusedEditableNodeTouched() { |
| 159 NotificationService::current()->Notify( | 157 NotificationService::current()->Notify( |
| 160 chrome::NOTIFICATION_FOCUSED_EDITABLE_NODE_TOUCHED, | 158 chrome::NOTIFICATION_FOCUSED_EDITABLE_NODE_TOUCHED, |
| 161 Source<RenderViewHost>(render_view_host()), | 159 Source<RenderViewHost>(render_view_host()), |
| 162 NotificationService::NoDetails()); | 160 NotificationService::NoDetails()); |
| 163 } | 161 } |
| OLD | NEW |