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/crx_installer.h" | 5 #include "chrome/browser/extensions/crx_installer.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 #include <set> | 8 #include <set> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 615 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
626 // the install (client_ is non NULL), or we are allowed to install this | 626 // the install (client_ is non NULL), or we are allowed to install this |
627 // silently. | 627 // silently. |
628 if (client_ || allow_silent_install_) { | 628 if (client_ || allow_silent_install_) { |
629 PermissionsUpdater perms_updater(profile()); | 629 PermissionsUpdater perms_updater(profile()); |
630 perms_updater.GrantActivePermissions(extension_, record_oauth2_grant_); | 630 perms_updater.GrantActivePermissions(extension_, record_oauth2_grant_); |
631 } | 631 } |
632 | 632 |
633 // Tell the frontend about the installation and hand off ownership of | 633 // Tell the frontend about the installation and hand off ownership of |
634 // extension_ to it. | 634 // extension_ to it. |
635 frontend_weak_->OnExtensionInstalled(extension_, | 635 frontend_weak_->OnExtensionInstalled(extension_, |
636 is_gallery_install(), | |
637 page_ordinal_, | 636 page_ordinal_, |
638 has_requirement_errors_); | 637 has_requirement_errors_); |
639 | 638 |
640 NotifyCrxInstallComplete(extension_.get()); | 639 NotifyCrxInstallComplete(extension_.get()); |
641 | 640 |
642 extension_ = NULL; | 641 extension_ = NULL; |
643 | 642 |
644 // We're done. We don't post any more tasks to ourselves so we are deleted | 643 // We're done. We don't post any more tasks to ourselves so we are deleted |
645 // soon. | 644 // soon. |
646 } | 645 } |
647 | 646 |
648 void CrxInstaller::NotifyCrxInstallComplete(const Extension* extension) { | 647 void CrxInstaller::NotifyCrxInstallComplete(const Extension* extension) { |
649 // Some users (such as the download shelf) need to know when a | 648 // Some users (such as the download shelf) need to know when a |
650 // CRXInstaller is done. Listening for the EXTENSION_* events | 649 // CRXInstaller is done. Listening for the EXTENSION_* events |
651 // is problematic because they don't know anything about the | 650 // is problematic because they don't know anything about the |
652 // extension before it is unpacked, so they cannot filter based | 651 // extension before it is unpacked, so they cannot filter based |
653 // on the extension. | 652 // on the extension. |
654 content::NotificationService::current()->Notify( | 653 content::NotificationService::current()->Notify( |
655 chrome::NOTIFICATION_CRX_INSTALLER_DONE, | 654 chrome::NOTIFICATION_CRX_INSTALLER_DONE, |
656 content::Source<CrxInstaller>(this), | 655 content::Source<CrxInstaller>(this), |
657 content::Details<const Extension>(extension)); | 656 content::Details<const Extension>(extension)); |
658 } | 657 } |
659 | 658 |
660 } // namespace extensions | 659 } // namespace extensions |
OLD | NEW |