| 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/event_router.h" | 5 #include "chrome/browser/extensions/event_router.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 640 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 651 case chrome::NOTIFICATION_EXTENSION_UNLOADED: { | 651 case chrome::NOTIFICATION_EXTENSION_UNLOADED: { |
| 652 // Remove all registered lazy listeners from our cache. | 652 // Remove all registered lazy listeners from our cache. |
| 653 UnloadedExtensionInfo* unloaded = | 653 UnloadedExtensionInfo* unloaded = |
| 654 content::Details<UnloadedExtensionInfo>(details).ptr(); | 654 content::Details<UnloadedExtensionInfo>(details).ptr(); |
| 655 listeners_.RemoveLazyListenersForExtension(unloaded->extension->id()); | 655 listeners_.RemoveLazyListenersForExtension(unloaded->extension->id()); |
| 656 break; | 656 break; |
| 657 } | 657 } |
| 658 case chrome::NOTIFICATION_EXTENSION_INSTALLED: { | 658 case chrome::NOTIFICATION_EXTENSION_INSTALLED: { |
| 659 // Dispatch the onInstalled event. | 659 // Dispatch the onInstalled event. |
| 660 const Extension* extension = | 660 const Extension* extension = |
| 661 content::Details<const Extension>(details).ptr(); | 661 content::Details<const InstalledExtensionInfo>(details)->extension; |
| 662 | 662 |
| 663 // Get the previous version, if this is an upgrade. | 663 // Get the previous version, if this is an upgrade. |
| 664 ExtensionService* service = | 664 ExtensionService* service = |
| 665 ExtensionSystem::Get(profile_)->extension_service(); | 665 ExtensionSystem::Get(profile_)->extension_service(); |
| 666 const Extension* old = service->GetExtensionById(extension->id(), true); | 666 const Extension* old = service->GetExtensionById(extension->id(), true); |
| 667 Version old_version; | 667 Version old_version; |
| 668 if (old) | 668 if (old) |
| 669 old_version = *old->version(); | 669 old_version = *old->version(); |
| 670 | 670 |
| 671 MessageLoop::current()->PostTask(FROM_HERE, | 671 MessageLoop::current()->PostTask(FROM_HERE, |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 725 copy->will_dispatch_callback = will_dispatch_callback; | 725 copy->will_dispatch_callback = will_dispatch_callback; |
| 726 return copy; | 726 return copy; |
| 727 } | 727 } |
| 728 | 728 |
| 729 EventListenerInfo::EventListenerInfo(const std::string& event_name, | 729 EventListenerInfo::EventListenerInfo(const std::string& event_name, |
| 730 const std::string& extension_id) | 730 const std::string& extension_id) |
| 731 : event_name(event_name), | 731 : event_name(event_name), |
| 732 extension_id(extension_id) {} | 732 extension_id(extension_id) {} |
| 733 | 733 |
| 734 } // namespace extensions | 734 } // namespace extensions |
| OLD | NEW |