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

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

Issue 7492051: Revert 94332 - Removal of Profile from content part 2. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 4 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 1345 matching lines...) Expand 10 before | Expand all | Expand 10 after
1356 // extension. 1356 // extension.
1357 NotificationService::current()->Notify( 1357 NotificationService::current()->Notify(
1358 chrome::NOTIFICATION_EXTENSION_LOADED, 1358 chrome::NOTIFICATION_EXTENSION_LOADED,
1359 Source<Profile>(profile_), 1359 Source<Profile>(profile_),
1360 Details<const Extension>(extension)); 1360 Details<const Extension>(extension));
1361 1361
1362 // Tell renderers about the new extension. 1362 // Tell renderers about the new extension.
1363 for (RenderProcessHost::iterator i(RenderProcessHost::AllHostsIterator()); 1363 for (RenderProcessHost::iterator i(RenderProcessHost::AllHostsIterator());
1364 !i.IsAtEnd(); i.Advance()) { 1364 !i.IsAtEnd(); i.Advance()) {
1365 RenderProcessHost* host = i.GetCurrentValue(); 1365 RenderProcessHost* host = i.GetCurrentValue();
1366 Profile* host_profile = 1366 if (host->profile()->GetOriginalProfile() ==
1367 Profile::FromBrowserContext(host->browser_context()); 1367 profile_->GetOriginalProfile()) {
1368 if (host_profile->GetOriginalProfile() == profile_->GetOriginalProfile()) {
1369 host->Send( 1368 host->Send(
1370 new ExtensionMsg_Loaded(ExtensionMsg_Loaded_Params( 1369 new ExtensionMsg_Loaded(ExtensionMsg_Loaded_Params(
1371 extension, extension->GetActivePermissions()))); 1370 extension, extension->GetActivePermissions())));
1372 } 1371 }
1373 } 1372 }
1374 1373
1375 // Tell a random-ass collection of other subsystems about the new extension. 1374 // Tell a random-ass collection of other subsystems about the new extension.
1376 // TODO(aa): What should we do with all this goop? Can it move into the 1375 // TODO(aa): What should we do with all this goop? Can it move into the
1377 // relevant objects via EXTENSION_LOADED? 1376 // relevant objects via EXTENSION_LOADED?
1378 1377
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
1454 const Extension* extension, UnloadedExtensionInfo::Reason reason) { 1453 const Extension* extension, UnloadedExtensionInfo::Reason reason) {
1455 UnloadedExtensionInfo details(extension, reason); 1454 UnloadedExtensionInfo details(extension, reason);
1456 NotificationService::current()->Notify( 1455 NotificationService::current()->Notify(
1457 chrome::NOTIFICATION_EXTENSION_UNLOADED, 1456 chrome::NOTIFICATION_EXTENSION_UNLOADED,
1458 Source<Profile>(profile_), 1457 Source<Profile>(profile_),
1459 Details<UnloadedExtensionInfo>(&details)); 1458 Details<UnloadedExtensionInfo>(&details));
1460 1459
1461 for (RenderProcessHost::iterator i(RenderProcessHost::AllHostsIterator()); 1460 for (RenderProcessHost::iterator i(RenderProcessHost::AllHostsIterator());
1462 !i.IsAtEnd(); i.Advance()) { 1461 !i.IsAtEnd(); i.Advance()) {
1463 RenderProcessHost* host = i.GetCurrentValue(); 1462 RenderProcessHost* host = i.GetCurrentValue();
1464 Profile* host_profile = 1463 if (host->profile()->GetOriginalProfile() ==
1465 Profile::FromBrowserContext(host->browser_context()); 1464 profile_->GetOriginalProfile()) {
1466 if (host_profile->GetOriginalProfile() == profile_->GetOriginalProfile())
1467 host->Send(new ExtensionMsg_Unloaded(extension->id())); 1465 host->Send(new ExtensionMsg_Unloaded(extension->id()));
1466 }
1468 } 1467 }
1469 1468
1470 profile_->UnregisterExtensionWithRequestContexts(extension->id(), reason); 1469 profile_->UnregisterExtensionWithRequestContexts(extension->id(), reason);
1471 profile_->GetExtensionSpecialStoragePolicy()-> 1470 profile_->GetExtensionSpecialStoragePolicy()->
1472 RevokeRightsForExtension(extension); 1471 RevokeRightsForExtension(extension);
1473 1472
1474 ExtensionWebUI::UnregisterChromeURLOverrides( 1473 ExtensionWebUI::UnregisterChromeURLOverrides(
1475 profile_, extension->GetChromeURLOverrides()); 1474 profile_, extension->GetChromeURLOverrides());
1476 1475
1477 #if defined(OS_CHROMEOS) 1476 #if defined(OS_CHROMEOS)
(...skipping 1083 matching lines...) Expand 10 before | Expand all | Expand 10 after
2561 2560
2562 ExtensionService::NaClModuleInfoList::iterator 2561 ExtensionService::NaClModuleInfoList::iterator
2563 ExtensionService::FindNaClModule(const GURL& url) { 2562 ExtensionService::FindNaClModule(const GURL& url) {
2564 for (NaClModuleInfoList::iterator iter = nacl_module_list_.begin(); 2563 for (NaClModuleInfoList::iterator iter = nacl_module_list_.begin();
2565 iter != nacl_module_list_.end(); ++iter) { 2564 iter != nacl_module_list_.end(); ++iter) {
2566 if (iter->url == url) 2565 if (iter->url == url)
2567 return iter; 2566 return iter;
2568 } 2567 }
2569 return nacl_module_list_.end(); 2568 return nacl_module_list_.end();
2570 } 2569 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_process_manager.cc ('k') | chrome/browser/extensions/extensions_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698