| Index: chrome/browser/extensions/crx_installer.cc
|
| diff --git a/chrome/browser/extensions/crx_installer.cc b/chrome/browser/extensions/crx_installer.cc
|
| index 17b919b1a02cef3074bb908945391aaf9687c91a..239e693d361279871a6377a326c1d99b8c7d2e3a 100644
|
| --- a/chrome/browser/extensions/crx_installer.cc
|
| +++ b/chrome/browser/extensions/crx_installer.cc
|
| @@ -99,7 +99,8 @@ CrxInstaller::CrxInstaller(base::WeakPtr<ExtensionService> frontend_weak,
|
| install_cause_(extension_misc::INSTALL_CAUSE_UNSET),
|
| creation_flags_(Extension::NO_FLAGS),
|
| off_store_install_allow_reason_(OffStoreInstallDisallowed),
|
| - did_handle_successfully_(true) {
|
| + did_handle_successfully_(true),
|
| + record_oauth2_grant_(false) {
|
| if (!approval)
|
| return;
|
|
|
| @@ -114,6 +115,7 @@ CrxInstaller::CrxInstaller(base::WeakPtr<ExtensionService> frontend_weak,
|
| approved_ = true;
|
| expected_manifest_.reset(approval->parsed_manifest->DeepCopy());
|
| expected_id_ = approval->extension_id;
|
| + record_oauth2_grant_ = approval->record_oauth2_grant;
|
| }
|
| }
|
|
|
| @@ -587,12 +589,15 @@ void CrxInstaller::ReportSuccessFromUIThread() {
|
| client_->OnInstallSuccess(extension_.get(), install_icon_.get());
|
| }
|
|
|
| + if (client_ && !approved_)
|
| + record_oauth2_grant_ = client_->record_oauth2_grant();
|
| +
|
| // We update the extension's granted permissions if the user already approved
|
| // the install (client_ is non NULL), or we are allowed to install this
|
| // silently.
|
| if (client_ || allow_silent_install_) {
|
| PermissionsUpdater perms_updater(profile());
|
| - perms_updater.GrantActivePermissions(extension_);
|
| + perms_updater.GrantActivePermissions(extension_, record_oauth2_grant_);
|
| }
|
|
|
| // Tell the frontend about the installation and hand off ownership of
|
|
|