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

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: Back to the future - reverting to my original approach 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
« no previous file with comments | « no previous file | chrome/browser/themes/theme_service_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 1144 matching lines...) Expand 10 before | Expand all | Expand 10 after
1155 1155
1156 void ExtensionService::NotifyExtensionUnloaded( 1156 void ExtensionService::NotifyExtensionUnloaded(
1157 const Extension* extension, 1157 const Extension* extension,
1158 extension_misc::UnloadedExtensionReason reason) { 1158 extension_misc::UnloadedExtensionReason reason) {
1159 UnloadedExtensionInfo details(extension, reason); 1159 UnloadedExtensionInfo details(extension, reason);
1160 content::NotificationService::current()->Notify( 1160 content::NotificationService::current()->Notify(
1161 chrome::NOTIFICATION_EXTENSION_UNLOADED, 1161 chrome::NOTIFICATION_EXTENSION_UNLOADED,
1162 content::Source<Profile>(profile_), 1162 content::Source<Profile>(profile_),
1163 content::Details<UnloadedExtensionInfo>(&details)); 1163 content::Details<UnloadedExtensionInfo>(&details));
1164 1164
1165 #if defined(ENABLE_THEMES)
1166 // If the current theme is being unloaded, tell ThemeService to revert back
1167 // to the default theme.
1168 if (reason != extension_misc::UNLOAD_REASON_UPDATE && extension->is_theme()) {
1169 ThemeService* theme_service = ThemeServiceFactory::GetForProfile(profile_);
1170 if (extension->id() == theme_service->GetThemeID())
1171 theme_service->UseDefaultTheme();
1172 }
1173 #endif
1174
1165 for (content::RenderProcessHost::iterator i( 1175 for (content::RenderProcessHost::iterator i(
1166 content::RenderProcessHost::AllHostsIterator()); 1176 content::RenderProcessHost::AllHostsIterator());
1167 !i.IsAtEnd(); i.Advance()) { 1177 !i.IsAtEnd(); i.Advance()) {
1168 content::RenderProcessHost* host = i.GetCurrentValue(); 1178 content::RenderProcessHost* host = i.GetCurrentValue();
1169 Profile* host_profile = 1179 Profile* host_profile =
1170 Profile::FromBrowserContext(host->GetBrowserContext()); 1180 Profile::FromBrowserContext(host->GetBrowserContext());
1171 if (host_profile->GetOriginalProfile() == profile_->GetOriginalProfile()) 1181 if (host_profile->GetOriginalProfile() == profile_->GetOriginalProfile())
1172 host->Send(new ExtensionMsg_Unloaded(extension->id())); 1182 host->Send(new ExtensionMsg_Unloaded(extension->id()));
1173 } 1183 }
1174 1184
(...skipping 1856 matching lines...) Expand 10 before | Expand all | Expand 10 after
3031 extension_id, kOnUpdateAvailableEvent); 3041 extension_id, kOnUpdateAvailableEvent);
3032 } else { 3042 } else {
3033 // Delay installation if the extension is not idle. 3043 // Delay installation if the extension is not idle.
3034 return !IsExtensionIdle(extension_id); 3044 return !IsExtensionIdle(extension_id);
3035 } 3045 }
3036 } 3046 }
3037 3047
3038 void ExtensionService::OnBlacklistUpdated() { 3048 void ExtensionService::OnBlacklistUpdated() {
3039 CheckManagementPolicy(); 3049 CheckManagementPolicy();
3040 } 3050 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/themes/theme_service_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698