Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(216)

Side by Side Diff: chrome/browser/extensions/extension_process_manager.cc

Issue 243001: Implement Browser Actions extensions.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 // Extension ids should get removed from the map before the process ids get 100 // Extension ids should get removed from the map before the process ids get
101 // reused from a dead renderer. 101 // reused from a dead renderer.
102 DCHECK(it == process_ids_.end()); 102 DCHECK(it == process_ids_.end());
103 process_ids_[extension_id] = process_id; 103 process_ids_[extension_id] = process_id;
104 104
105 ExtensionsService* extension_service = 105 ExtensionsService* extension_service =
106 browsing_instance_->profile()->GetExtensionsService(); 106 browsing_instance_->profile()->GetExtensionsService();
107 107
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 (ContextualActionMap::const_iterator i =
111 extension->page_actions().begin();
111 i != extension->page_actions().end(); ++i) { 112 i != extension->page_actions().end(); ++i) {
112 page_action_ids.push_back(i->first); 113 page_action_ids.push_back(i->first);
113 } 114 }
114 115
115 RenderProcessHost* rph = RenderProcessHost::FromID(process_id); 116 RenderProcessHost* rph = RenderProcessHost::FromID(process_id);
116 rph->Send(new ViewMsg_Extension_UpdatePageActions(extension_id, 117 rph->Send(new ViewMsg_Extension_UpdatePageActions(extension_id,
117 page_action_ids)); 118 page_action_ids));
118 } 119 }
119 120
120 void ExtensionProcessManager::UnregisterExtensionProcess(int process_id) { 121 void ExtensionProcessManager::UnregisterExtensionProcess(int process_id) {
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 void ExtensionProcessManager::OnExtensionHostCreated(ExtensionHost* host, 198 void ExtensionProcessManager::OnExtensionHostCreated(ExtensionHost* host,
198 bool is_background) { 199 bool is_background) {
199 all_hosts_.insert(host); 200 all_hosts_.insert(host);
200 if (is_background) 201 if (is_background)
201 background_hosts_.insert(host); 202 background_hosts_.insert(host);
202 NotificationService::current()->Notify( 203 NotificationService::current()->Notify(
203 NotificationType::EXTENSION_HOST_CREATED, 204 NotificationType::EXTENSION_HOST_CREATED,
204 Source<ExtensionProcessManager>(this), 205 Source<ExtensionProcessManager>(this),
205 Details<ExtensionHost>(host)); 206 Details<ExtensionHost>(host));
206 } 207 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698