| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/extensions/extension_process_manager.h" | 5 #include "chrome/browser/extensions/extension_process_manager.h" |
| 6 | 6 |
| 7 #include "chrome/browser/browsing_instance.h" | 7 #include "chrome/browser/browsing_instance.h" |
| 8 #include "chrome/browser/extensions/extension_host.h" | 8 #include "chrome/browser/extensions/extension_host.h" |
| 9 #include "chrome/browser/extensions/extensions_service.h" | 9 #include "chrome/browser/extensions/extensions_service.h" |
| 10 #include "chrome/browser/profile.h" | 10 #include "chrome/browser/profile.h" |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 std::vector<std::string> page_action_ids; | 108 std::vector<std::string> page_action_ids; |
| 109 Extension* extension = extension_service->GetExtensionById(extension_id); | 109 Extension* extension = extension_service->GetExtensionById(extension_id); |
| 110 for (PageActionMap::const_iterator i = extension->page_actions().begin(); | 110 for (PageActionMap::const_iterator i = extension->page_actions().begin(); |
| 111 i != extension->page_actions().end(); ++i) { | 111 i != extension->page_actions().end(); ++i) { |
| 112 page_action_ids.push_back(i->first); | 112 page_action_ids.push_back(i->first); |
| 113 } | 113 } |
| 114 | 114 |
| 115 RenderProcessHost* rph = RenderProcessHost::FromID(process_id); | 115 RenderProcessHost* rph = RenderProcessHost::FromID(process_id); |
| 116 rph->Send(new ViewMsg_Extension_UpdatePageActions(extension_id, | 116 rph->Send(new ViewMsg_Extension_UpdatePageActions(extension_id, |
| 117 page_action_ids)); | 117 page_action_ids)); |
| 118 |
| 119 // Send l10n messages to the renderer - if there are any. |
| 120 if (extension->message_bundle()) { |
| 121 rph->Send(new ViewMsg_Extension_SetL10nMessages( |
| 122 extension_id, *extension->message_bundle()->dictionary())); |
| 123 } |
| 118 } | 124 } |
| 119 | 125 |
| 120 void ExtensionProcessManager::UnregisterExtensionProcess(int process_id) { | 126 void ExtensionProcessManager::UnregisterExtensionProcess(int process_id) { |
| 121 ProcessIDMap::iterator it = process_ids_.begin(); | 127 ProcessIDMap::iterator it = process_ids_.begin(); |
| 122 while (it != process_ids_.end()) { | 128 while (it != process_ids_.end()) { |
| 123 if (it->second == process_id) | 129 if (it->second == process_id) |
| 124 process_ids_.erase(it++); | 130 process_ids_.erase(it++); |
| 125 else | 131 else |
| 126 ++it; | 132 ++it; |
| 127 } | 133 } |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 197 void ExtensionProcessManager::OnExtensionHostCreated(ExtensionHost* host, | 203 void ExtensionProcessManager::OnExtensionHostCreated(ExtensionHost* host, |
| 198 bool is_background) { | 204 bool is_background) { |
| 199 all_hosts_.insert(host); | 205 all_hosts_.insert(host); |
| 200 if (is_background) | 206 if (is_background) |
| 201 background_hosts_.insert(host); | 207 background_hosts_.insert(host); |
| 202 NotificationService::current()->Notify( | 208 NotificationService::current()->Notify( |
| 203 NotificationType::EXTENSION_HOST_CREATED, | 209 NotificationType::EXTENSION_HOST_CREATED, |
| 204 Source<ExtensionProcessManager>(this), | 210 Source<ExtensionProcessManager>(this), |
| 205 Details<ExtensionHost>(host)); | 211 Details<ExtensionHost>(host)); |
| 206 } | 212 } |
| OLD | NEW |