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

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: Self review, Devlin review. 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..9fda2756b52b4804662bace550b16f481133f8e7 100644
--- a/chrome/browser/extensions/api/webstore_private/webstore_private_api.cc
+++ b/chrome/browser/extensions/api/webstore_private/webstore_private_api.cc
@@ -31,7 +31,6 @@
#include "content/public/browser/web_contents.h"
#include "extensions/browser/extension_registry.h"
#include "extensions/browser/extension_system.h"
-#include "extensions/browser/extension_util.h"
#include "extensions/common/extension.h"
#include "net/base/load_flags.h"
#include "net/url_request/url_request.h"
@@ -207,8 +206,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 +427,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 +525,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;
}
« no previous file with comments | « chrome/browser/extensions/api/storage/managed_value_store_cache.cc ('k') | chrome/browser/extensions/crx_installer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698