| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 2405 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2416 CHECK(extension); | 2416 CHECK(extension); |
| 2417 delayed_updates_for_idle_.Remove(extension_id); | 2417 delayed_updates_for_idle_.Remove(extension_id); |
| 2418 | 2418 |
| 2419 if (!extension_prefs_->FinishDelayedInstallInfo(extension_id)) | 2419 if (!extension_prefs_->FinishDelayedInstallInfo(extension_id)) |
| 2420 NOTREACHED(); | 2420 NOTREACHED(); |
| 2421 | 2421 |
| 2422 FinishInstallation(extension); | 2422 FinishInstallation(extension); |
| 2423 } | 2423 } |
| 2424 | 2424 |
| 2425 void ExtensionService::FinishInstallation(const Extension* extension) { | 2425 void ExtensionService::FinishInstallation(const Extension* extension) { |
| 2426 bool is_update = GetInstalledExtension(extension->id()) != NULL; |
| 2427 extensions::InstalledExtensionInfo details(extension, is_update); |
| 2426 content::NotificationService::current()->Notify( | 2428 content::NotificationService::current()->Notify( |
| 2427 chrome::NOTIFICATION_EXTENSION_INSTALLED, | 2429 chrome::NOTIFICATION_EXTENSION_INSTALLED, |
| 2428 content::Source<Profile>(profile_), | 2430 content::Source<Profile>(profile_), |
| 2429 content::Details<const Extension>(extension)); | 2431 content::Details<const extensions::InstalledExtensionInfo>(&details)); |
| 2430 | 2432 |
| 2431 bool unacknowledged_external = IsUnacknowledgedExternalExtension(extension); | 2433 bool unacknowledged_external = IsUnacknowledgedExternalExtension(extension); |
| 2432 | 2434 |
| 2433 // Unpacked extensions default to allowing file access, but if that has been | 2435 // Unpacked extensions default to allowing file access, but if that has been |
| 2434 // overridden, don't reset the value. | 2436 // overridden, don't reset the value. |
| 2435 if (Manifest::ShouldAlwaysAllowFileAccess(extension->location()) && | 2437 if (Manifest::ShouldAlwaysAllowFileAccess(extension->location()) && |
| 2436 !extension_prefs_->HasAllowFileAccessSetting(extension->id())) { | 2438 !extension_prefs_->HasAllowFileAccessSetting(extension->id())) { |
| 2437 extension_prefs_->SetAllowFileAccess(extension->id(), true); | 2439 extension_prefs_->SetAllowFileAccess(extension->id(), true); |
| 2438 } | 2440 } |
| 2439 | 2441 |
| (...skipping 665 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3105 } | 3107 } |
| 3106 | 3108 |
| 3107 void ExtensionService::AddUpdateObserver(extensions::UpdateObserver* observer) { | 3109 void ExtensionService::AddUpdateObserver(extensions::UpdateObserver* observer) { |
| 3108 update_observers_.AddObserver(observer); | 3110 update_observers_.AddObserver(observer); |
| 3109 } | 3111 } |
| 3110 | 3112 |
| 3111 void ExtensionService::RemoveUpdateObserver( | 3113 void ExtensionService::RemoveUpdateObserver( |
| 3112 extensions::UpdateObserver* observer) { | 3114 extensions::UpdateObserver* observer) { |
| 3113 update_observers_.RemoveObserver(observer); | 3115 update_observers_.RemoveObserver(observer); |
| 3114 } | 3116 } |
| OLD | NEW |