Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(310)

Side by Side Diff: chrome/browser/extensions/crx_installer.cc

Issue 510943003: Register granting of previously withheld permissions as a permissions (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add initialization calls before granting permissions Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 785 matching lines...) Expand 10 before | Expand all | Expand 10 after
796 if (!update_from_settings_page_) { 796 if (!update_from_settings_page_) {
797 // If there is a client, tell the client about installation. 797 // If there is a client, tell the client about installation.
798 if (client_) 798 if (client_)
799 client_->OnInstallSuccess(extension(), install_icon_.get()); 799 client_->OnInstallSuccess(extension(), install_icon_.get());
800 800
801 // We update the extension's granted permissions if the user already 801 // We update the extension's granted permissions if the user already
802 // approved the install (client_ is non NULL), or we are allowed to install 802 // approved the install (client_ is non NULL), or we are allowed to install
803 // this silently. 803 // this silently.
804 if ((client_ || allow_silent_install_) && grant_permissions_) { 804 if ((client_ || allow_silent_install_) && grant_permissions_) {
805 PermissionsUpdater perms_updater(profile()); 805 PermissionsUpdater perms_updater(profile());
806 perms_updater.InitializePermissions(extension());
not at google - send to devlin 2014/08/28 03:18:46 Can we do this when extension() gets created?
gpdavis 2014/08/28 19:02:39 Looks like this gets created in sandboxed_unpacker
806 perms_updater.GrantActivePermissions(extension()); 807 perms_updater.GrantActivePermissions(extension());
807 } 808 }
808 } 809 }
809 810
810 service_weak_->OnExtensionInstalled( 811 service_weak_->OnExtensionInstalled(
811 extension(), page_ordinal_, install_flags_); 812 extension(), page_ordinal_, install_flags_);
812 NotifyCrxInstallComplete(true); 813 NotifyCrxInstallComplete(true);
813 } 814 }
814 815
815 void CrxInstaller::NotifyCrxInstallBegin() { 816 void CrxInstaller::NotifyCrxInstallBegin() {
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
892 if (!prefs->DidExtensionEscalatePermissions(extension()->id())) 893 if (!prefs->DidExtensionEscalatePermissions(extension()->id()))
893 return; 894 return;
894 895
895 if (client_) { 896 if (client_) {
896 AddRef(); // Balanced in InstallUIProceed() and InstallUIAbort(). 897 AddRef(); // Balanced in InstallUIProceed() and InstallUIAbort().
897 client_->ConfirmReEnable(this, extension()); 898 client_->ConfirmReEnable(this, extension());
898 } 899 }
899 } 900 }
900 901
901 } // namespace extensions 902 } // namespace extensions
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/extensions/unpacked_installer.cc » ('j') | chrome/browser/extensions/unpacked_installer.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698