| 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 <iterator> | 8 #include <iterator> |
| 9 #include <set> | 9 #include <set> |
| 10 | 10 |
| (...skipping 2532 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |