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

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

Issue 11434002: Change ThemeService to handle uninstalled themes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Review feedback. Created 8 years 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) 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
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->id() == ThemeService::GetThemeIDForProfile(profile_)) {
1175 ThemeServiceFactory::GetForProfile(profile_)->UseDefaultTheme();
1176 }
1177 #endif
1178
1171 for (content::RenderProcessHost::iterator i( 1179 for (content::RenderProcessHost::iterator i(
1172 content::RenderProcessHost::AllHostsIterator()); 1180 content::RenderProcessHost::AllHostsIterator());
1173 !i.IsAtEnd(); i.Advance()) { 1181 !i.IsAtEnd(); i.Advance()) {
1174 content::RenderProcessHost* host = i.GetCurrentValue(); 1182 content::RenderProcessHost* host = i.GetCurrentValue();
1175 Profile* host_profile = 1183 Profile* host_profile =
1176 Profile::FromBrowserContext(host->GetBrowserContext()); 1184 Profile::FromBrowserContext(host->GetBrowserContext());
1177 if (host_profile->GetOriginalProfile() == profile_->GetOriginalProfile()) 1185 if (host_profile->GetOriginalProfile() == profile_->GetOriginalProfile())
1178 host->Send(new ExtensionMsg_Unloaded(extension->id())); 1186 host->Send(new ExtensionMsg_Unloaded(extension->id()));
1179 } 1187 }
1180 1188
(...skipping 1804 matching lines...) Expand 10 before | Expand all | Expand 10 after
2985 extension_id, kOnUpdateAvailableEvent); 2993 extension_id, kOnUpdateAvailableEvent);
2986 } else { 2994 } else {
2987 // Delay installation if the extension is not idle. 2995 // Delay installation if the extension is not idle.
2988 return !IsExtensionIdle(extension_id); 2996 return !IsExtensionIdle(extension_id);
2989 } 2997 }
2990 } 2998 }
2991 2999
2992 void ExtensionService::OnBlacklistUpdated() { 3000 void ExtensionService::OnBlacklistUpdated() {
2993 CheckManagementPolicy(); 3001 CheckManagementPolicy();
2994 } 3002 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/themes/theme_service_unittest.cc » ('j') | chrome/browser/themes/theme_service_unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698