Commit c422a864 authored by kalman@chromium.org's avatar kalman@chromium.org

Pass through Extension::FROM_WEBSTORE to Extension::Create when installing an

extension from the webstore. Without that, webstore-specific permissions
checking doesn't happen, notably, whitelisted extensions requesting the
"experimental" permission (e.g. Accessibility Developer Tools) can't be
installed without enabling experimental APIs in about:flags.


Review URL: https://chromiumcodereview.appspot.com/10834082

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@149190 0039d316-1c4b-4281-b951-d872f2087c98
parent 73b45377
...@@ -358,7 +358,12 @@ void BeginInstallWithManifestFunction::OnWebstoreParseSuccess( ...@@ -358,7 +358,12 @@ void BeginInstallWithManifestFunction::OnWebstoreParseSuccess(
std::string error; std::string error;
dummy_extension_ = ExtensionInstallPrompt::GetLocalizedExtensionForDisplay( dummy_extension_ = ExtensionInstallPrompt::GetLocalizedExtensionForDisplay(
parsed_manifest_.get(), id, localized_name_, "", &error); parsed_manifest_.get(),
Extension::FROM_WEBSTORE,
id,
localized_name_,
"",
&error);
if (!dummy_extension_) { if (!dummy_extension_) {
OnWebstoreParseFailure(id_, WebstoreInstallHelper::Delegate::MANIFEST_ERROR, OnWebstoreParseFailure(id_, WebstoreInstallHelper::Delegate::MANIFEST_ERROR,
......
...@@ -232,6 +232,7 @@ const IssueAdviceInfoEntry& ExtensionInstallPrompt::Prompt::GetOAuthIssue( ...@@ -232,6 +232,7 @@ const IssueAdviceInfoEntry& ExtensionInstallPrompt::Prompt::GetOAuthIssue(
scoped_refptr<Extension> scoped_refptr<Extension>
ExtensionInstallPrompt::GetLocalizedExtensionForDisplay( ExtensionInstallPrompt::GetLocalizedExtensionForDisplay(
const DictionaryValue* manifest, const DictionaryValue* manifest,
int flags,
const std::string& id, const std::string& id,
const std::string& localized_name, const std::string& localized_name,
const std::string& localized_description, const std::string& localized_description,
...@@ -253,7 +254,7 @@ scoped_refptr<Extension> ...@@ -253,7 +254,7 @@ scoped_refptr<Extension>
FilePath(), FilePath(),
Extension::INTERNAL, Extension::INTERNAL,
localized_manifest.get() ? *localized_manifest.get() : *manifest, localized_manifest.get() ? *localized_manifest.get() : *manifest,
Extension::NO_FLAGS, flags,
id, id,
error); error);
} }
......
...@@ -159,6 +159,7 @@ class ExtensionInstallPrompt : public ImageLoadingTracker::Observer, ...@@ -159,6 +159,7 @@ class ExtensionInstallPrompt : public ImageLoadingTracker::Observer,
// description with the localizations if provided. // description with the localizations if provided.
static scoped_refptr<extensions::Extension> GetLocalizedExtensionForDisplay( static scoped_refptr<extensions::Extension> GetLocalizedExtensionForDisplay(
const base::DictionaryValue* manifest, const base::DictionaryValue* manifest,
int flags, // Extension::InitFromValueFlags
const std::string& id, const std::string& id,
const std::string& localized_name, const std::string& localized_name,
const std::string& localized_description, const std::string& localized_description,
......
...@@ -351,7 +351,12 @@ void WebstoreInlineInstaller::OnWebstoreParseSuccess( ...@@ -351,7 +351,12 @@ void WebstoreInlineInstaller::OnWebstoreParseSuccess(
rating_count_); rating_count_);
std::string error; std::string error;
dummy_extension_ = ExtensionInstallPrompt::GetLocalizedExtensionForDisplay( dummy_extension_ = ExtensionInstallPrompt::GetLocalizedExtensionForDisplay(
manifest, id_, localized_name_, localized_description_, &error); manifest,
Extension::REQUIRE_KEY | Extension::FROM_WEBSTORE,
id_,
localized_name_,
localized_description_,
&error);
if (!dummy_extension_) { if (!dummy_extension_) {
OnWebstoreParseFailure(id_, WebstoreInstallHelper::Delegate::MANIFEST_ERROR, OnWebstoreParseFailure(id_, WebstoreInstallHelper::Delegate::MANIFEST_ERROR,
kInvalidManifestError); kInvalidManifestError);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment