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_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 1285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1296 // extension. | 1296 // extension. |
1297 NotificationService::current()->Notify( | 1297 NotificationService::current()->Notify( |
1298 chrome::NOTIFICATION_EXTENSION_LOADED, | 1298 chrome::NOTIFICATION_EXTENSION_LOADED, |
1299 Source<Profile>(profile_), | 1299 Source<Profile>(profile_), |
1300 Details<const Extension>(extension)); | 1300 Details<const Extension>(extension)); |
1301 | 1301 |
1302 // Tell renderers about the new extension. | 1302 // Tell renderers about the new extension. |
1303 for (RenderProcessHost::iterator i(RenderProcessHost::AllHostsIterator()); | 1303 for (RenderProcessHost::iterator i(RenderProcessHost::AllHostsIterator()); |
1304 !i.IsAtEnd(); i.Advance()) { | 1304 !i.IsAtEnd(); i.Advance()) { |
1305 RenderProcessHost* host = i.GetCurrentValue(); | 1305 RenderProcessHost* host = i.GetCurrentValue(); |
1306 if (host->profile()->GetOriginalProfile() == | 1306 Profile* host_profile = static_cast<Profile*>(host->context()); |
| 1307 if (host_profile->GetOriginalProfile() == |
1307 profile_->GetOriginalProfile()) { | 1308 profile_->GetOriginalProfile()) { |
1308 host->Send( | 1309 host->Send( |
1309 new ExtensionMsg_Loaded(ExtensionMsg_Loaded_Params(extension))); | 1310 new ExtensionMsg_Loaded(ExtensionMsg_Loaded_Params(extension))); |
1310 } | 1311 } |
1311 } | 1312 } |
1312 | 1313 |
1313 // Tell a random-ass collection of other subsystems about the new extension. | 1314 // Tell a random-ass collection of other subsystems about the new extension. |
1314 // TODO(aa): What should we do with all this goop? Can it move into the | 1315 // TODO(aa): What should we do with all this goop? Can it move into the |
1315 // relevant objects via EXTENSION_LOADED? | 1316 // relevant objects via EXTENSION_LOADED? |
1316 | 1317 |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1392 const Extension* extension, UnloadedExtensionInfo::Reason reason) { | 1393 const Extension* extension, UnloadedExtensionInfo::Reason reason) { |
1393 UnloadedExtensionInfo details(extension, reason); | 1394 UnloadedExtensionInfo details(extension, reason); |
1394 NotificationService::current()->Notify( | 1395 NotificationService::current()->Notify( |
1395 chrome::NOTIFICATION_EXTENSION_UNLOADED, | 1396 chrome::NOTIFICATION_EXTENSION_UNLOADED, |
1396 Source<Profile>(profile_), | 1397 Source<Profile>(profile_), |
1397 Details<UnloadedExtensionInfo>(&details)); | 1398 Details<UnloadedExtensionInfo>(&details)); |
1398 | 1399 |
1399 for (RenderProcessHost::iterator i(RenderProcessHost::AllHostsIterator()); | 1400 for (RenderProcessHost::iterator i(RenderProcessHost::AllHostsIterator()); |
1400 !i.IsAtEnd(); i.Advance()) { | 1401 !i.IsAtEnd(); i.Advance()) { |
1401 RenderProcessHost* host = i.GetCurrentValue(); | 1402 RenderProcessHost* host = i.GetCurrentValue(); |
1402 if (host->profile()->GetOriginalProfile() == | 1403 Profile* profile = static_cast<Profile*>(host->context()); |
1403 profile_->GetOriginalProfile()) { | 1404 if (profile->GetOriginalProfile() == profile_->GetOriginalProfile()) |
1404 host->Send(new ExtensionMsg_Unloaded(extension->id())); | 1405 host->Send(new ExtensionMsg_Unloaded(extension->id())); |
1405 } | |
1406 } | 1406 } |
1407 | 1407 |
1408 profile_->UnregisterExtensionWithRequestContexts(extension->id(), reason); | 1408 profile_->UnregisterExtensionWithRequestContexts(extension->id(), reason); |
1409 profile_->GetExtensionSpecialStoragePolicy()-> | 1409 profile_->GetExtensionSpecialStoragePolicy()-> |
1410 RevokeRightsForExtension(extension); | 1410 RevokeRightsForExtension(extension); |
1411 | 1411 |
1412 ExtensionWebUI::UnregisterChromeURLOverrides( | 1412 ExtensionWebUI::UnregisterChromeURLOverrides( |
1413 profile_, extension->GetChromeURLOverrides()); | 1413 profile_, extension->GetChromeURLOverrides()); |
1414 | 1414 |
1415 #if defined(OS_CHROMEOS) | 1415 #if defined(OS_CHROMEOS) |
(...skipping 1053 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2469 | 2469 |
2470 ExtensionService::NaClModuleInfoList::iterator | 2470 ExtensionService::NaClModuleInfoList::iterator |
2471 ExtensionService::FindNaClModule(const GURL& url) { | 2471 ExtensionService::FindNaClModule(const GURL& url) { |
2472 for (NaClModuleInfoList::iterator iter = nacl_module_list_.begin(); | 2472 for (NaClModuleInfoList::iterator iter = nacl_module_list_.begin(); |
2473 iter != nacl_module_list_.end(); ++iter) { | 2473 iter != nacl_module_list_.end(); ++iter) { |
2474 if (iter->url == url) | 2474 if (iter->url == url) |
2475 return iter; | 2475 return iter; |
2476 } | 2476 } |
2477 return nacl_module_list_.end(); | 2477 return nacl_module_list_.end(); |
2478 } | 2478 } |
OLD | NEW |