| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 <iterator> | 8 #include <iterator> |
| 9 #include <set> | 9 #include <set> |
| 10 | 10 |
| (...skipping 1013 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1024 // don't need to know about themes). | 1024 // don't need to know about themes). |
| 1025 if (!extension->is_theme()) { | 1025 if (!extension->is_theme()) { |
| 1026 for (content::RenderProcessHost::iterator i( | 1026 for (content::RenderProcessHost::iterator i( |
| 1027 content::RenderProcessHost::AllHostsIterator()); | 1027 content::RenderProcessHost::AllHostsIterator()); |
| 1028 !i.IsAtEnd(); i.Advance()) { | 1028 !i.IsAtEnd(); i.Advance()) { |
| 1029 content::RenderProcessHost* host = i.GetCurrentValue(); | 1029 content::RenderProcessHost* host = i.GetCurrentValue(); |
| 1030 Profile* host_profile = | 1030 Profile* host_profile = |
| 1031 Profile::FromBrowserContext(host->GetBrowserContext()); | 1031 Profile::FromBrowserContext(host->GetBrowserContext()); |
| 1032 if (host_profile->GetOriginalProfile() == | 1032 if (host_profile->GetOriginalProfile() == |
| 1033 profile_->GetOriginalProfile()) { | 1033 profile_->GetOriginalProfile()) { |
| 1034 // We don't need to include tab permisisons here, since the extension |
| 1035 // was just loaded. |
| 1034 std::vector<ExtensionMsg_Loaded_Params> loaded_extensions( | 1036 std::vector<ExtensionMsg_Loaded_Params> loaded_extensions( |
| 1035 1, ExtensionMsg_Loaded_Params(extension)); | 1037 1, ExtensionMsg_Loaded_Params(extension, |
| 1038 false /* no tab permissions */)); |
| 1036 host->Send( | 1039 host->Send( |
| 1037 new ExtensionMsg_Loaded(loaded_extensions)); | 1040 new ExtensionMsg_Loaded(loaded_extensions)); |
| 1038 } | 1041 } |
| 1039 } | 1042 } |
| 1040 } | 1043 } |
| 1041 | 1044 |
| 1042 // Tell subsystems that use the EXTENSION_LOADED notification about the new | 1045 // Tell subsystems that use the EXTENSION_LOADED notification about the new |
| 1043 // extension. | 1046 // extension. |
| 1044 // | 1047 // |
| 1045 // NOTE: It is important that this happen after notifying the renderers about | 1048 // NOTE: It is important that this happen after notifying the renderers about |
| (...skipping 1498 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2544 } | 2547 } |
| 2545 | 2548 |
| 2546 void ExtensionService::OnProfileDestructionStarted() { | 2549 void ExtensionService::OnProfileDestructionStarted() { |
| 2547 ExtensionIdSet ids_to_unload = registry_->enabled_extensions().GetIDs(); | 2550 ExtensionIdSet ids_to_unload = registry_->enabled_extensions().GetIDs(); |
| 2548 for (ExtensionIdSet::iterator it = ids_to_unload.begin(); | 2551 for (ExtensionIdSet::iterator it = ids_to_unload.begin(); |
| 2549 it != ids_to_unload.end(); | 2552 it != ids_to_unload.end(); |
| 2550 ++it) { | 2553 ++it) { |
| 2551 UnloadExtension(*it, UnloadedExtensionInfo::REASON_PROFILE_SHUTDOWN); | 2554 UnloadExtension(*it, UnloadedExtensionInfo::REASON_PROFILE_SHUTDOWN); |
| 2552 } | 2555 } |
| 2553 } | 2556 } |
| OLD | NEW |