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

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

Issue 7464009: Removal of Profile from content part 1. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: browser_context Created 9 years, 5 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) 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_service.h" 5 #include "chrome/browser/extensions/extension_service.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <set> 8 #include <set>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 1319 matching lines...) Expand 10 before | Expand all | Expand 10 after
1330 // extension. 1330 // extension.
1331 NotificationService::current()->Notify( 1331 NotificationService::current()->Notify(
1332 chrome::NOTIFICATION_EXTENSION_LOADED, 1332 chrome::NOTIFICATION_EXTENSION_LOADED,
1333 Source<Profile>(profile_), 1333 Source<Profile>(profile_),
1334 Details<const Extension>(extension)); 1334 Details<const Extension>(extension));
1335 1335
1336 // Tell renderers about the new extension. 1336 // Tell renderers about the new extension.
1337 for (RenderProcessHost::iterator i(RenderProcessHost::AllHostsIterator()); 1337 for (RenderProcessHost::iterator i(RenderProcessHost::AllHostsIterator());
1338 !i.IsAtEnd(); i.Advance()) { 1338 !i.IsAtEnd(); i.Advance()) {
1339 RenderProcessHost* host = i.GetCurrentValue(); 1339 RenderProcessHost* host = i.GetCurrentValue();
1340 if (host->profile()->GetOriginalProfile() == 1340 Profile* host_profile = static_cast<Profile*>(host->context());
1341 if (host_profile->GetOriginalProfile() ==
1341 profile_->GetOriginalProfile()) { 1342 profile_->GetOriginalProfile()) {
1342 host->Send( 1343 host->Send(
1343 new ExtensionMsg_Loaded(ExtensionMsg_Loaded_Params(extension))); 1344 new ExtensionMsg_Loaded(ExtensionMsg_Loaded_Params(extension)));
1344 } 1345 }
1345 } 1346 }
1346 1347
1347 // Tell a random-ass collection of other subsystems about the new extension. 1348 // Tell a random-ass collection of other subsystems about the new extension.
1348 // TODO(aa): What should we do with all this goop? Can it move into the 1349 // TODO(aa): What should we do with all this goop? Can it move into the
1349 // relevant objects via EXTENSION_LOADED? 1350 // relevant objects via EXTENSION_LOADED?
1350 1351
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
1426 const Extension* extension, UnloadedExtensionInfo::Reason reason) { 1427 const Extension* extension, UnloadedExtensionInfo::Reason reason) {
1427 UnloadedExtensionInfo details(extension, reason); 1428 UnloadedExtensionInfo details(extension, reason);
1428 NotificationService::current()->Notify( 1429 NotificationService::current()->Notify(
1429 chrome::NOTIFICATION_EXTENSION_UNLOADED, 1430 chrome::NOTIFICATION_EXTENSION_UNLOADED,
1430 Source<Profile>(profile_), 1431 Source<Profile>(profile_),
1431 Details<UnloadedExtensionInfo>(&details)); 1432 Details<UnloadedExtensionInfo>(&details));
1432 1433
1433 for (RenderProcessHost::iterator i(RenderProcessHost::AllHostsIterator()); 1434 for (RenderProcessHost::iterator i(RenderProcessHost::AllHostsIterator());
1434 !i.IsAtEnd(); i.Advance()) { 1435 !i.IsAtEnd(); i.Advance()) {
1435 RenderProcessHost* host = i.GetCurrentValue(); 1436 RenderProcessHost* host = i.GetCurrentValue();
1436 if (host->profile()->GetOriginalProfile() == 1437 Profile* profile = static_cast<Profile*>(host->context());
1437 profile_->GetOriginalProfile()) { 1438 if (profile->GetOriginalProfile() == profile_->GetOriginalProfile())
1438 host->Send(new ExtensionMsg_Unloaded(extension->id())); 1439 host->Send(new ExtensionMsg_Unloaded(extension->id()));
1439 }
1440 } 1440 }
1441 1441
1442 profile_->UnregisterExtensionWithRequestContexts(extension->id(), reason); 1442 profile_->UnregisterExtensionWithRequestContexts(extension->id(), reason);
1443 profile_->GetExtensionSpecialStoragePolicy()-> 1443 profile_->GetExtensionSpecialStoragePolicy()->
1444 RevokeRightsForExtension(extension); 1444 RevokeRightsForExtension(extension);
1445 1445
1446 ExtensionWebUI::UnregisterChromeURLOverrides( 1446 ExtensionWebUI::UnregisterChromeURLOverrides(
1447 profile_, extension->GetChromeURLOverrides()); 1447 profile_, extension->GetChromeURLOverrides());
1448 1448
1449 #if defined(OS_CHROMEOS) 1449 #if defined(OS_CHROMEOS)
(...skipping 1053 matching lines...) Expand 10 before | Expand all | Expand 10 after
2503 2503
2504 ExtensionService::NaClModuleInfoList::iterator 2504 ExtensionService::NaClModuleInfoList::iterator
2505 ExtensionService::FindNaClModule(const GURL& url) { 2505 ExtensionService::FindNaClModule(const GURL& url) {
2506 for (NaClModuleInfoList::iterator iter = nacl_module_list_.begin(); 2506 for (NaClModuleInfoList::iterator iter = nacl_module_list_.begin();
2507 iter != nacl_module_list_.end(); ++iter) { 2507 iter != nacl_module_list_.end(); ++iter) {
2508 if (iter->url == url) 2508 if (iter->url == url)
2509 return iter; 2509 return iter;
2510 } 2510 }
2511 return nacl_module_list_.end(); 2511 return nacl_module_list_.end();
2512 } 2512 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698