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

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

Issue 11445038: Revert changes to have ExtensionService notify ThemeService directly for themes (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix merge error 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 | « chrome/browser/extensions/extension_service.h ('k') | chrome/browser/themes/theme_service.h » ('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 <iterator> 8 #include <iterator>
9 #include <set> 9 #include <set>
10 10
(...skipping 2532 matching lines...) Expand 10 before | Expand all | Expand 10 after
2543 void ExtensionService::FinishInstallation(const Extension* extension) { 2543 void ExtensionService::FinishInstallation(const Extension* extension) {
2544 content::NotificationService::current()->Notify( 2544 content::NotificationService::current()->Notify(
2545 chrome::NOTIFICATION_EXTENSION_INSTALLED, 2545 chrome::NOTIFICATION_EXTENSION_INSTALLED,
2546 content::Source<Profile>(profile_), 2546 content::Source<Profile>(profile_),
2547 content::Details<const Extension>(extension)); 2547 content::Details<const Extension>(extension));
2548 2548
2549 bool unacknowledged_external = IsUnacknowledgedExternalExtension(extension); 2549 bool unacknowledged_external = IsUnacknowledgedExternalExtension(extension);
2550 2550
2551 AddExtension(extension); 2551 AddExtension(extension);
2552 2552
2553 #if defined(ENABLE_THEMES)
2554 // We do this here since AddExtension() is always called on browser
2555 // startup, and we only really care about the last theme installed.
2556 // If that ever changes and we have to move this code somewhere
2557 // else, it should be somewhere that's not in the startup path.
2558 if (extension->is_theme() && extensions_.GetByID(extension->id())) {
2559 DCHECK_EQ(extensions_.GetByID(extension->id()), extension);
2560 // Now that the theme extension is visible from outside the
2561 // ExtensionService, notify the ThemeService about the
2562 // newly-installed theme.
2563 ThemeServiceFactory::GetForProfile(profile_)->SetTheme(extension);
2564 }
2565 #endif
2566
2567 // If this is a new external extension that was disabled, alert the user 2553 // If this is a new external extension that was disabled, alert the user
2568 // so he can reenable it. We do this last so that it has already been 2554 // so he can reenable it. We do this last so that it has already been
2569 // added to our list of extensions. 2555 // added to our list of extensions.
2570 if (unacknowledged_external) { 2556 if (unacknowledged_external) {
2571 UpdateExternalExtensionAlert(); 2557 UpdateExternalExtensionAlert();
2572 UMA_HISTOGRAM_ENUMERATION("Extensions.ExternalExtensionEvent", 2558 UMA_HISTOGRAM_ENUMERATION("Extensions.ExternalExtensionEvent",
2573 EXTERNAL_EXTENSION_INSTALLED, 2559 EXTERNAL_EXTENSION_INSTALLED,
2574 EXTERNAL_EXTENSION_BUCKET_BOUNDARY); 2560 EXTERNAL_EXTENSION_BUCKET_BOUNDARY);
2575 } 2561 }
2576 } 2562 }
(...skipping 574 matching lines...) Expand 10 before | Expand all | Expand 10 after
3151 scoped_refptr<const Extension> extension = GetInstalledExtension(*it); 3137 scoped_refptr<const Extension> extension = GetInstalledExtension(*it);
3152 DCHECK(extension); 3138 DCHECK(extension);
3153 if (!extension) 3139 if (!extension)
3154 continue; 3140 continue;
3155 blacklisted_extensions_.Insert(extension); 3141 blacklisted_extensions_.Insert(extension);
3156 UnloadExtension(*it, extension_misc::UNLOAD_REASON_BLACKLIST); 3142 UnloadExtension(*it, extension_misc::UNLOAD_REASON_BLACKLIST);
3157 } 3143 }
3158 3144
3159 IdentifyAlertableExtensions(); 3145 IdentifyAlertableExtensions();
3160 } 3146 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_service.h ('k') | chrome/browser/themes/theme_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698