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

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

Issue 341050: Implement loading blacklists from extensions.... (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: use real extension Created 11 years, 1 month 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 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 SiteInstance* ExtensionProcessManager::GetSiteInstanceForURL(const GURL& url) { 168 SiteInstance* ExtensionProcessManager::GetSiteInstanceForURL(const GURL& url) {
169 return browsing_instance_->GetSiteInstanceForURL(url); 169 return browsing_instance_->GetSiteInstanceForURL(url);
170 } 170 }
171 171
172 void ExtensionProcessManager::Observe(NotificationType type, 172 void ExtensionProcessManager::Observe(NotificationType type,
173 const NotificationSource& source, 173 const NotificationSource& source,
174 const NotificationDetails& details) { 174 const NotificationDetails& details) {
175 switch (type.value) { 175 switch (type.value) {
176 case NotificationType::EXTENSIONS_READY: 176 case NotificationType::EXTENSIONS_READY:
177 CreateBackgroundHosts(this, 177 CreateBackgroundHosts(this,
178 Source<ExtensionsService>(source).ptr()->extensions()); 178 Source<Profile>(source).ptr()->GetExtensionsService()->extensions());
179 break; 179 break;
180 180
181 case NotificationType::EXTENSION_LOADED: { 181 case NotificationType::EXTENSION_LOADED: {
182 ExtensionsService* service = Source<ExtensionsService>(source).ptr(); 182 ExtensionsService* service =
183 Source<Profile>(source).ptr()->GetExtensionsService();
183 if (service->is_ready()) { 184 if (service->is_ready()) {
184 Extension* extension = Details<Extension>(details).ptr(); 185 Extension* extension = Details<Extension>(details).ptr();
185 ::CreateBackgroundHost(this, extension); 186 ::CreateBackgroundHost(this, extension);
186 } 187 }
187 break; 188 break;
188 } 189 }
189 190
190 case NotificationType::EXTENSION_UNLOADED: { 191 case NotificationType::EXTENSION_UNLOADED: {
191 Extension* extension = Details<Extension>(details).ptr(); 192 Extension* extension = Details<Extension>(details).ptr();
192 for (ExtensionHostSet::iterator iter = background_hosts_.begin(); 193 for (ExtensionHostSet::iterator iter = background_hosts_.begin();
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
224 void ExtensionProcessManager::OnExtensionHostCreated(ExtensionHost* host, 225 void ExtensionProcessManager::OnExtensionHostCreated(ExtensionHost* host,
225 bool is_background) { 226 bool is_background) {
226 all_hosts_.insert(host); 227 all_hosts_.insert(host);
227 if (is_background) 228 if (is_background)
228 background_hosts_.insert(host); 229 background_hosts_.insert(host);
229 NotificationService::current()->Notify( 230 NotificationService::current()->Notify(
230 NotificationType::EXTENSION_HOST_CREATED, 231 NotificationType::EXTENSION_HOST_CREATED,
231 Source<ExtensionProcessManager>(this), 232 Source<ExtensionProcessManager>(this),
232 Details<ExtensionHost>(host)); 233 Details<ExtensionHost>(host));
233 } 234 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_host.cc ('k') | chrome/browser/extensions/extensions_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698