| Index: chrome/browser/extensions/bundle_installer.cc
|
| diff --git a/chrome/browser/extensions/bundle_installer.cc b/chrome/browser/extensions/bundle_installer.cc
|
| index fcd6adade518c588abee2e63bc042edff8bf37f7..5ac29b080e456881e8340a49287889426345cbfd 100644
|
| --- a/chrome/browser/extensions/bundle_installer.cc
|
| +++ b/chrome/browser/extensions/bundle_installer.cc
|
| @@ -13,6 +13,7 @@
|
| #include "base/strings/utf_string_conversions.h"
|
| #include "base/values.h"
|
| #include "chrome/browser/extensions/crx_installer.h"
|
| +#include "chrome/browser/extensions/permissions_updater.h"
|
| #include "chrome/browser/profiles/profile.h"
|
| #include "chrome/browser/ui/browser.h"
|
| #include "chrome/browser/ui/browser_finder.h"
|
| @@ -41,18 +42,24 @@ AutoApproveForTest g_auto_approve_for_test = DO_NOT_SKIP;
|
| // Creates a dummy extension and sets the manifest's name to the item's
|
| // localized name.
|
| scoped_refptr<Extension> CreateDummyExtension(const BundleInstaller::Item& item,
|
| - base::DictionaryValue* manifest) {
|
| + base::DictionaryValue* manifest,
|
| + Profile* profile) {
|
| // We require localized names so we can have nice error messages when we can't
|
| // parse an extension manifest.
|
| CHECK(!item.localized_name.empty());
|
|
|
| std::string error;
|
| - return Extension::Create(base::FilePath(),
|
| - Manifest::INTERNAL,
|
| - *manifest,
|
| - Extension::NO_FLAGS,
|
| - item.id,
|
| - &error);
|
| + scoped_refptr<Extension> extension = Extension::Create(base::FilePath(),
|
| + Manifest::INTERNAL,
|
| + *manifest,
|
| + Extension::NO_FLAGS,
|
| + item.id,
|
| + &error);
|
| + // Initialize permissions so that withheld permissions don't end up in the
|
| + // install prompt.
|
| + PermissionsUpdater(profile).InitializePermissions(
|
| + extension.get(), PermissionsUpdater::INIT_FLAG_TRANSIENT);
|
| + return extension;
|
| }
|
|
|
| bool IsAppPredicate(scoped_refptr<const Extension> extension) {
|
| @@ -295,7 +302,8 @@ void BundleInstaller::OnWebstoreParseSuccess(
|
| const std::string& id,
|
| const SkBitmap& icon,
|
| base::DictionaryValue* manifest) {
|
| - dummy_extensions_.push_back(CreateDummyExtension(items_[id], manifest));
|
| + dummy_extensions_.push_back(
|
| + CreateDummyExtension(items_[id], manifest, profile_));
|
| parsed_manifests_[id] = linked_ptr<base::DictionaryValue>(manifest);
|
|
|
| ShowPromptIfDoneParsing();
|
|
|