| Index: chrome/browser/extensions/extension_webstore_private_api.cc
|
| diff --git a/chrome/browser/extensions/extension_webstore_private_api.cc b/chrome/browser/extensions/extension_webstore_private_api.cc
|
| index 8f393a5e9ea18356d4063629d75fa73f0c9c93d2..9d66238a9d21056a36c50e1a35bf042ce9f1f753 100644
|
| --- a/chrome/browser/extensions/extension_webstore_private_api.cc
|
| +++ b/chrome/browser/extensions/extension_webstore_private_api.cc
|
| @@ -53,8 +53,6 @@ const char kInvalidManifestError[] = "Invalid manifest";
|
| const char kNoPreviousBeginInstallWithManifestError[] =
|
| "* does not match a previous call to beginInstallWithManifest3";
|
| const char kUserCancelledError[] = "User cancelled install";
|
| -const char kPermissionDeniedError[] =
|
| - "You do not have permission to use this method.";
|
|
|
| ProfileSyncService* test_sync_service = NULL;
|
|
|
| @@ -68,17 +66,6 @@ ProfileSyncService* GetSyncService(Profile* profile) {
|
| return ProfileSyncServiceFactory::GetInstance()->GetForProfile(profile);
|
| }
|
|
|
| -bool IsWebStoreURL(Profile* profile, const GURL& url) {
|
| - ExtensionService* service = profile->GetExtensionService();
|
| - const Extension* store = service->GetWebStoreApp();
|
| - if (!store) {
|
| - NOTREACHED();
|
| - return false;
|
| - }
|
| - return (service->extensions()->GetHostedAppByURL(ExtensionURLInfo(url)) ==
|
| - store);
|
| -}
|
| -
|
| // Whitelists extension IDs for use by webstorePrivate.silentlyInstall.
|
| bool trust_test_ids = false;
|
|
|
| @@ -151,11 +138,6 @@ BeginInstallWithManifestFunction::BeginInstallWithManifestFunction()
|
| BeginInstallWithManifestFunction::~BeginInstallWithManifestFunction() {}
|
|
|
| bool BeginInstallWithManifestFunction::RunImpl() {
|
| - if (!IsWebStoreURL(profile_, source_url())) {
|
| - SetResult(PERMISSION_DENIED);
|
| - return false;
|
| - }
|
| -
|
| DictionaryValue* details = NULL;
|
| EXTENSION_FUNCTION_VALIDATE(args_->GetDictionary(0, &details));
|
| CHECK(details);
|
| @@ -352,9 +334,6 @@ void BeginInstallWithManifestFunction::InstallUIAbort(bool user_initiated) {
|
| }
|
|
|
| bool CompleteInstallFunction::RunImpl() {
|
| - if (!IsWebStoreURL(profile_, source_url()))
|
| - return false;
|
| -
|
| std::string id;
|
| EXTENSION_FUNCTION_VALIDATE(args_->GetString(0, &id));
|
| if (!Extension::IdIsValid(id)) {
|
| @@ -385,11 +364,6 @@ SilentlyInstallFunction::SilentlyInstallFunction() {}
|
| SilentlyInstallFunction::~SilentlyInstallFunction() {}
|
|
|
| bool SilentlyInstallFunction::RunImpl() {
|
| - if (!IsWebStoreURL(profile_, source_url())) {
|
| - error_ = kPermissionDeniedError;
|
| - return false;
|
| - }
|
| -
|
| DictionaryValue* details = NULL;
|
| EXTENSION_FUNCTION_VALIDATE(args_->GetDictionary(0, &details));
|
| CHECK(details);
|
| @@ -465,15 +439,11 @@ void SilentlyInstallFunction::OnExtensionInstallFailure(
|
| }
|
|
|
| bool GetBrowserLoginFunction::RunImpl() {
|
| - if (!IsWebStoreURL(profile_, source_url()))
|
| - return false;
|
| result_.reset(CreateLoginResult(profile_->GetOriginalProfile()));
|
| return true;
|
| }
|
|
|
| bool GetStoreLoginFunction::RunImpl() {
|
| - if (!IsWebStoreURL(profile_, source_url()))
|
| - return false;
|
| ExtensionService* service = profile_->GetExtensionService();
|
| ExtensionPrefs* prefs = service->extension_prefs();
|
| std::string login;
|
| @@ -486,8 +456,6 @@ bool GetStoreLoginFunction::RunImpl() {
|
| }
|
|
|
| bool SetStoreLoginFunction::RunImpl() {
|
| - if (!IsWebStoreURL(profile_, source_url()))
|
| - return false;
|
| std::string login;
|
| EXTENSION_FUNCTION_VALIDATE(args_->GetString(0, &login));
|
| ExtensionService* service = profile_->GetExtensionService();
|
|
|