| 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/extensions/extension_process_manager.h" | 5 #include "chrome/browser/extensions/extension_process_manager.h" |
| 6 | 6 |
| 7 #include "chrome/browser/browser_window.h" | 7 #include "chrome/browser/browser_window.h" |
| 8 #include "content/browser/browsing_instance.h" | 8 #include "content/browser/browsing_instance.h" |
| 9 #if defined(OS_MACOSX) | 9 #if defined(OS_MACOSX) |
| 10 #include "chrome/browser/extensions/extension_host_mac.h" | 10 #include "chrome/browser/extensions/extension_host_mac.h" |
| 11 #endif | 11 #endif |
| 12 #include "chrome/browser/extensions/extension_host.h" | 12 #include "chrome/browser/extensions/extension_host.h" |
| 13 #include "chrome/browser/extensions/extension_service.h" | 13 #include "chrome/browser/extensions/extension_service.h" |
| 14 #include "chrome/browser/profiles/profile.h" | 14 #include "chrome/browser/profiles/profile.h" |
| 15 #include "chrome/browser/ui/browser.h" | 15 #include "chrome/browser/ui/browser.h" |
| 16 #include "chrome/common/extensions/extension.h" | 16 #include "chrome/common/extensions/extension.h" |
| 17 #include "chrome/common/extensions/extension_action.h" | 17 #include "chrome/common/extensions/extension_action.h" |
| 18 #include "chrome/common/render_messages.h" | 18 #include "chrome/common/extensions/extension_messages.h" |
| 19 #include "chrome/common/url_constants.h" | 19 #include "chrome/common/url_constants.h" |
| 20 #include "content/browser/renderer_host/render_view_host.h" | 20 #include "content/browser/renderer_host/render_view_host.h" |
| 21 #include "content/browser/site_instance.h" | 21 #include "content/browser/site_instance.h" |
| 22 #include "content/browser/tab_contents/tab_contents.h" | 22 #include "content/browser/tab_contents/tab_contents.h" |
| 23 #include "content/common/notification_service.h" | 23 #include "content/common/notification_service.h" |
| 24 #include "content/common/notification_type.h" | 24 #include "content/common/notification_type.h" |
| 25 | 25 |
| 26 namespace { | 26 namespace { |
| 27 | 27 |
| 28 // Incognito profiles use this process manager. It is mostly a shim that decides | 28 // Incognito profiles use this process manager. It is mostly a shim that decides |
| (...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 229 ExtensionService* extension_service = | 229 ExtensionService* extension_service = |
| 230 browsing_instance_->profile()->GetExtensionService(); | 230 browsing_instance_->profile()->GetExtensionService(); |
| 231 | 231 |
| 232 std::vector<std::string> page_action_ids; | 232 std::vector<std::string> page_action_ids; |
| 233 const Extension* extension = | 233 const Extension* extension = |
| 234 extension_service->GetExtensionById(extension_id, false); | 234 extension_service->GetExtensionById(extension_id, false); |
| 235 if (extension->page_action()) | 235 if (extension->page_action()) |
| 236 page_action_ids.push_back(extension->page_action()->id()); | 236 page_action_ids.push_back(extension->page_action()->id()); |
| 237 | 237 |
| 238 RenderProcessHost* rph = RenderProcessHost::FromID(process_id); | 238 RenderProcessHost* rph = RenderProcessHost::FromID(process_id); |
| 239 rph->Send(new ViewMsg_Extension_UpdatePageActions(extension_id, | 239 rph->Send(new ExtensionMsg_UpdatePageActions(extension_id, page_action_ids)); |
| 240 page_action_ids)); | |
| 241 } | 240 } |
| 242 | 241 |
| 243 void ExtensionProcessManager::UnregisterExtensionProcess(int process_id) { | 242 void ExtensionProcessManager::UnregisterExtensionProcess(int process_id) { |
| 244 ProcessIDMap::iterator it = process_ids_.begin(); | 243 ProcessIDMap::iterator it = process_ids_.begin(); |
| 245 while (it != process_ids_.end()) { | 244 while (it != process_ids_.end()) { |
| 246 if (it->second == process_id) | 245 if (it->second == process_id) |
| 247 process_ids_.erase(it++); | 246 process_ids_.erase(it++); |
| 248 else | 247 else |
| 249 ++it; | 248 ++it; |
| 250 } | 249 } |
| (...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 462 if (service && service->is_ready()) | 461 if (service && service->is_ready()) |
| 463 CreateBackgroundHosts(this, service->extensions()); | 462 CreateBackgroundHosts(this, service->extensions()); |
| 464 } | 463 } |
| 465 break; | 464 break; |
| 466 } | 465 } |
| 467 default: | 466 default: |
| 468 ExtensionProcessManager::Observe(type, source, details); | 467 ExtensionProcessManager::Observe(type, source, details); |
| 469 break; | 468 break; |
| 470 } | 469 } |
| 471 } | 470 } |
| OLD | NEW |