OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 1150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1161 | 1161 |
1162 void ExtensionService::NotifyExtensionUnloaded( | 1162 void ExtensionService::NotifyExtensionUnloaded( |
1163 const Extension* extension, | 1163 const Extension* extension, |
1164 extension_misc::UnloadedExtensionReason reason) { | 1164 extension_misc::UnloadedExtensionReason reason) { |
1165 UnloadedExtensionInfo details(extension, reason); | 1165 UnloadedExtensionInfo details(extension, reason); |
1166 content::NotificationService::current()->Notify( | 1166 content::NotificationService::current()->Notify( |
1167 chrome::NOTIFICATION_EXTENSION_UNLOADED, | 1167 chrome::NOTIFICATION_EXTENSION_UNLOADED, |
1168 content::Source<Profile>(profile_), | 1168 content::Source<Profile>(profile_), |
1169 content::Details<UnloadedExtensionInfo>(&details)); | 1169 content::Details<UnloadedExtensionInfo>(&details)); |
1170 | 1170 |
1171 #if defined(ENABLE_THEMES) | |
1172 // Let the ThemeService know that the theme has been unloaded. | |
1173 if (reason != extension_misc::UNLOAD_REASON_UPDATE && | |
1174 extension->is_theme()) { | |
1175 ThemeService* theme_service = ThemeServiceFactory::GetForProfile(profile_); | |
akalin
2012/11/29 20:40:12
can you use ThemeService::GetThemeIDForProfile()?
Andrew T Wilson (Slow)
2012/11/30 12:44:55
Done. If you are concerned about startup regressio
| |
1176 if (extension->id() == theme_service->GetThemeID()) | |
1177 theme_service->UseDefaultTheme(); | |
1178 } | |
1179 #endif | |
1180 | |
1171 for (content::RenderProcessHost::iterator i( | 1181 for (content::RenderProcessHost::iterator i( |
1172 content::RenderProcessHost::AllHostsIterator()); | 1182 content::RenderProcessHost::AllHostsIterator()); |
1173 !i.IsAtEnd(); i.Advance()) { | 1183 !i.IsAtEnd(); i.Advance()) { |
1174 content::RenderProcessHost* host = i.GetCurrentValue(); | 1184 content::RenderProcessHost* host = i.GetCurrentValue(); |
1175 Profile* host_profile = | 1185 Profile* host_profile = |
1176 Profile::FromBrowserContext(host->GetBrowserContext()); | 1186 Profile::FromBrowserContext(host->GetBrowserContext()); |
1177 if (host_profile->GetOriginalProfile() == profile_->GetOriginalProfile()) | 1187 if (host_profile->GetOriginalProfile() == profile_->GetOriginalProfile()) |
1178 host->Send(new ExtensionMsg_Unloaded(extension->id())); | 1188 host->Send(new ExtensionMsg_Unloaded(extension->id())); |
1179 } | 1189 } |
1180 | 1190 |
(...skipping 1804 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2985 extension_id, kOnUpdateAvailableEvent); | 2995 extension_id, kOnUpdateAvailableEvent); |
2986 } else { | 2996 } else { |
2987 // Delay installation if the extension is not idle. | 2997 // Delay installation if the extension is not idle. |
2988 return !IsExtensionIdle(extension_id); | 2998 return !IsExtensionIdle(extension_id); |
2989 } | 2999 } |
2990 } | 3000 } |
2991 | 3001 |
2992 void ExtensionService::OnBlacklistUpdated() { | 3002 void ExtensionService::OnBlacklistUpdated() { |
2993 CheckManagementPolicy(); | 3003 CheckManagementPolicy(); |
2994 } | 3004 } |
OLD | NEW |