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

Unified Diff: chrome/browser/extensions/api/webstore_private/webstore_private_api.cc

Issue 1497193002: Remove all the ephemeral apps code. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Tests Created 5 years 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/api/webstore_private/webstore_private_api.cc
diff --git a/chrome/browser/extensions/api/webstore_private/webstore_private_api.cc b/chrome/browser/extensions/api/webstore_private/webstore_private_api.cc
index f127643292d580d8b76c936dd9ac6b96203042be..8a7816c55e6fcf01516e28b26d8ebc6e627ee439 100644
--- a/chrome/browser/extensions/api/webstore_private/webstore_private_api.cc
+++ b/chrome/browser/extensions/api/webstore_private/webstore_private_api.cc
@@ -207,8 +207,10 @@ WebstorePrivateBeginInstallWithManifest3Function::Run() {
InstallTracker* tracker = InstallTracker::Get(browser_context());
DCHECK(tracker);
- if (util::IsExtensionInstalledPermanently(details().id, browser_context()) ||
- tracker->GetActiveInstall(details().id)) {
+ bool is_installed =
+ extensions::ExtensionRegistry::Get(browser_context())->GetExtensionById(
+ details().id, extensions::ExtensionRegistry::EVERYTHING) != nullptr;
+ if (is_installed || tracker->GetActiveInstall(details().id)) {
return RespondNow(BuildResponse(
api::webstore_private::RESULT_ALREADY_INSTALLED,
kAlreadyInstalledError));
@@ -426,26 +428,6 @@ WebstorePrivateCompleteInstallFunction::Run() {
approval_->enable_launcher);
}
- // If the target extension has already been installed ephemerally and is
- // up to date, it can be promoted to a regular installed extension and
- // downloading from the Web Store is not necessary.
- const Extension* extension = ExtensionRegistry::Get(browser_context())->
- GetExtensionById(params->expected_id, ExtensionRegistry::EVERYTHING);
- if (extension && approval_->dummy_extension.get() &&
- util::IsEphemeralApp(extension->id(), browser_context()) &&
- extension->version()->CompareTo(*approval_->dummy_extension->version()) >=
- 0) {
- install_ui::ShowPostInstallUIForApproval(
- browser_context(), *approval_, extension);
-
- ExtensionService* extension_service =
- ExtensionSystem::Get(browser_context())->extension_service();
- extension_service->PromoteEphemeralApp(extension, false);
- OnInstallSuccess(extension->id());
- VLOG(1) << "Install success, sending response";
- return RespondNow(NoArguments());
- }
-
// Balanced in OnExtensionInstallSuccess() or OnExtensionInstallFailure().
AddRef();
@@ -544,7 +526,10 @@ void WebstorePrivateInstallBundleFunction::OnFetchComplete(
BundleInstaller::ItemList items;
for (const auto& entry : params_->contents) {
// Skip already-installed items.
- if (util::IsExtensionInstalledPermanently(entry->id, browser_context()) ||
+ bool is_installed =
+ extensions::ExtensionRegistry::Get(browser_context())->GetExtensionById(
+ entry->id, extensions::ExtensionRegistry::EVERYTHING) != nullptr;
+ if (is_installed ||
InstallTracker::Get(browser_context())->GetActiveInstall(entry->id)) {
continue;
}

Powered by Google App Engine
This is Rietveld 408576698