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 783 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
794 if (!update_from_settings_page_) { | 794 if (!update_from_settings_page_) { |
795 // If there is a client, tell the client about installation. | 795 // If there is a client, tell the client about installation. |
796 if (client_) | 796 if (client_) |
797 client_->OnInstallSuccess(extension(), install_icon_.get()); | 797 client_->OnInstallSuccess(extension(), install_icon_.get()); |
798 | 798 |
799 // We update the extension's granted permissions if the user already | 799 // We update the extension's granted permissions if the user already |
800 // approved the install (client_ is non NULL), or we are allowed to install | 800 // approved the install (client_ is non NULL), or we are allowed to install |
801 // this silently. | 801 // this silently. |
802 if ((client_ || allow_silent_install_) && grant_permissions_) { | 802 if ((client_ || allow_silent_install_) && grant_permissions_) { |
803 PermissionsUpdater perms_updater(profile()); | 803 PermissionsUpdater perms_updater(profile()); |
| 804 perms_updater.InitializePermissions(extension()); |
804 perms_updater.GrantActivePermissions(extension()); | 805 perms_updater.GrantActivePermissions(extension()); |
805 } | 806 } |
806 } | 807 } |
807 | 808 |
808 service_weak_->OnExtensionInstalled( | 809 service_weak_->OnExtensionInstalled( |
809 extension(), page_ordinal_, install_flags_); | 810 extension(), page_ordinal_, install_flags_); |
810 NotifyCrxInstallComplete(true); | 811 NotifyCrxInstallComplete(true); |
811 } | 812 } |
812 | 813 |
813 void CrxInstaller::NotifyCrxInstallBegin() { | 814 void CrxInstaller::NotifyCrxInstallBegin() { |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
890 if (!prefs->DidExtensionEscalatePermissions(extension()->id())) | 891 if (!prefs->DidExtensionEscalatePermissions(extension()->id())) |
891 return; | 892 return; |
892 | 893 |
893 if (client_) { | 894 if (client_) { |
894 AddRef(); // Balanced in InstallUIProceed() and InstallUIAbort(). | 895 AddRef(); // Balanced in InstallUIProceed() and InstallUIAbort(). |
895 client_->ConfirmReEnable(this, extension()); | 896 client_->ConfirmReEnable(this, extension()); |
896 } | 897 } |
897 } | 898 } |
898 | 899 |
899 } // namespace extensions | 900 } // namespace extensions |
OLD | NEW |