summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorbenwells <benwells@chromium.org>2015-10-13 16:38:46 -0700
committerCommit bot <commit-bot@chromium.org>2015-10-13 23:39:38 +0000
commitcb4422c1ee7c1909afed5edbce2cbc3dcaaea80a (patch)
tree51d55586cef6cb5b71a86ac17f6b5cb7734d4a5a /chrome
parent778ff470b7022b5e0244a471d5041586aaf2b5b6 (diff)
downloadchromium_src-cb4422c1ee7c1909afed5edbce2cbc3dcaaea80a.zip
chromium_src-cb4422c1ee7c1909afed5edbce2cbc3dcaaea80a.tar.gz
chromium_src-cb4422c1ee7c1909afed5edbce2cbc3dcaaea80a.tar.bz2
Remove ability for users to launch ephemeral apps.
Test code can still do this. BUG=517735 Review URL: https://codereview.chromium.org/1395043002 Cr-Commit-Position: refs/heads/master@{#353904}
Diffstat (limited to 'chrome')
-rw-r--r--chrome/app/generated_resources.grd6
-rw-r--r--chrome/browser/about_flags.cc5
-rw-r--r--chrome/browser/apps/ephemeral_app_launcher.cc477
-rw-r--r--chrome/browser/apps/ephemeral_app_launcher.h157
-rw-r--r--chrome/browser/apps/ephemeral_app_launcher_browsertest.cc563
-rw-r--r--chrome/browser/extensions/active_install_data.cc4
-rw-r--r--chrome/browser/extensions/active_install_data.h1
-rw-r--r--chrome/browser/extensions/api/webstore_private/webstore_private_api.cc101
-rw-r--r--chrome/browser/extensions/api/webstore_private/webstore_private_apitest.cc40
-rw-r--r--chrome/browser/extensions/crx_installer.cc1
-rw-r--r--chrome/browser/extensions/install_observer.cc3
-rw-r--r--chrome/browser/extensions/install_observer.h1
-rw-r--r--chrome/browser/extensions/install_tracker.cc1
-rw-r--r--chrome/browser/extensions/install_tracker_unittest.cc5
-rw-r--r--chrome/browser/extensions/webstore_installer.cc4
-rw-r--r--chrome/browser/extensions/webstore_installer.h3
-rw-r--r--chrome/browser/extensions/webstore_standalone_installer.cc13
-rw-r--r--chrome/browser/ui/app_list/extension_app_model_builder.cc2
-rw-r--r--chrome/browser/ui/app_list/search/webstore/webstore_result.cc1
-rw-r--r--chrome/chrome_browser_extensions.gypi2
-rw-r--r--chrome/chrome_tests.gypi1
-rw-r--r--chrome/common/chrome_switches.cc4
-rw-r--r--chrome/common/chrome_switches.h1
-rw-r--r--chrome/test/data/extensions/platform_apps/ephemeral_launcher/app.crxbin1246 -> 0 bytes
-rw-r--r--chrome/test/data/extensions/platform_apps/ephemeral_launcher/app.pem28
-rw-r--r--chrome/test/data/extensions/platform_apps/ephemeral_launcher/app/index.html1
-rw-r--r--chrome/test/data/extensions/platform_apps/ephemeral_launcher/app/main.js10
-rw-r--r--chrome/test/data/extensions/platform_apps/ephemeral_launcher/app/manifest.json10
-rw-r--r--chrome/test/data/extensions/platform_apps/ephemeral_launcher/app_with_permissions.crxbin1272 -> 0 bytes
-rw-r--r--chrome/test/data/extensions/platform_apps/ephemeral_launcher/app_with_permissions.pem28
-rw-r--r--chrome/test/data/extensions/platform_apps/ephemeral_launcher/app_with_permissions/index.html1
-rw-r--r--chrome/test/data/extensions/platform_apps/ephemeral_launcher/app_with_permissions/main.js10
-rw-r--r--chrome/test/data/extensions/platform_apps/ephemeral_launcher/app_with_permissions/manifest.json11
-rw-r--r--chrome/test/data/extensions/platform_apps/ephemeral_launcher/extension/manifest.json5
-rw-r--r--chrome/test/data/extensions/platform_apps/ephemeral_launcher/inlineinstall/detail/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeid6
-rw-r--r--chrome/test/data/extensions/platform_apps/ephemeral_launcher/inlineinstall/detail/haaaaaaaaaaaaaaaaaaaaaaaaaaappid6
-rw-r--r--chrome/test/data/extensions/platform_apps/ephemeral_launcher/inlineinstall/detail/kbiancnbopdghkfedjhfdoegjadfjeal6
-rw-r--r--chrome/test/data/extensions/platform_apps/ephemeral_launcher/inlineinstall/detail/lnbochkobjfnhbnbljgfgokadhmbahcn6
-rw-r--r--chrome/test/data/extensions/platform_apps/ephemeral_launcher/inlineinstall/detail/mbfcnecjknjpipkfkoangpfnhhlpamki6
-rw-r--r--chrome/test/data/extensions/platform_apps/ephemeral_launcher/legacy_app.pem28
-rw-r--r--chrome/test/data/extensions/platform_apps/ephemeral_launcher/legacy_app/main.html11
-rw-r--r--chrome/test/data/extensions/platform_apps/ephemeral_launcher/legacy_app/main.js5
-rw-r--r--chrome/test/data/extensions/platform_apps/ephemeral_launcher/legacy_app/manifest.json10
-rw-r--r--chrome/test/data/extensions/platform_apps/ephemeral_launcher/webstore_common.js39
-rw-r--r--chrome/test/data/extensions/platform_apps/ephemeral_launcher/webstore_launch_app.html8
-rw-r--r--chrome/test/data/extensions/platform_apps/ephemeral_launcher/webstore_launch_app.js69
-rw-r--r--chrome/test/data/extensions/platform_apps/ephemeral_launcher/webstore_launch_disabled.html8
-rw-r--r--chrome/test/data/extensions/platform_apps/ephemeral_launcher/webstore_launch_disabled.js30
48 files changed, 13 insertions, 1725 deletions
diff --git a/chrome/app/generated_resources.grd b/chrome/app/generated_resources.grd
index 631128e..0fb2c67 100644
--- a/chrome/app/generated_resources.grd
+++ b/chrome/app/generated_resources.grd
@@ -6329,12 +6329,6 @@ Keep your key file in a safe place. You will need it to create new versions of y
<message name="IDS_FLAGS_ENABLE_HOSTED_APP_QUIT_NOTIFICATION_DESCRIPTION" desc="Description for the flag to enable a notification when quitting with hosted apps.">
Display a notification when quitting Chrome if hosted apps are currently running.
</message>
- <message name="IDS_FLAGS_ENABLE_EPHEMERAL_APPS_IN_WEBSTORE_NAME" desc="Name of the flag to enable ephemeral apps in the webstore.">
- Enable experimental ephemeral apps from the webstore.
- </message>
- <message name="IDS_FLAGS_ENABLE_EPHEMERAL_APPS_IN_WEBSTORE_DESCRIPTION" desc="Description for the flag to enable ephemeral apps.">
- Enables ephemeral apps, which are launched without installing in Chrome, to be launched from the Chrome WebStore. Requires the experimental App Launcher to be enabled.
- </message>
<if expr="is_android">
<message name="IDS_FLAGS_DISABLE_PULL_TO_REFRESH_EFFECT_NAME" desc="Name of the flag to disable the pull-to-refresh effect.">
Disable the pull-to-refresh effect.
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
index 805876c..95affd34 100644
--- a/chrome/browser/about_flags.cc
+++ b/chrome/browser/about_flags.cc
@@ -1458,11 +1458,6 @@ const Experiment kExperiments[] = {
kOsMac,
SINGLE_VALUE_TYPE(switches::kHostedAppQuitNotification)},
#endif
- {"enable-ephemeral-apps-in-webstore",
- IDS_FLAGS_ENABLE_EPHEMERAL_APPS_IN_WEBSTORE_NAME,
- IDS_FLAGS_ENABLE_EPHEMERAL_APPS_IN_WEBSTORE_DESCRIPTION,
- kOsAll,
- SINGLE_VALUE_TYPE(switches::kEnableEphemeralAppsInWebstore)},
#if defined(OS_ANDROID)
{"disable-pull-to-refresh-effect",
IDS_FLAGS_DISABLE_PULL_TO_REFRESH_EFFECT_NAME,
diff --git a/chrome/browser/apps/ephemeral_app_launcher.cc b/chrome/browser/apps/ephemeral_app_launcher.cc
deleted file mode 100644
index c9d4fa0..0000000
--- a/chrome/browser/apps/ephemeral_app_launcher.cc
+++ /dev/null
@@ -1,477 +0,0 @@
-// Copyright 2013 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "chrome/browser/apps/ephemeral_app_launcher.h"
-
-#include "base/command_line.h"
-#include "base/strings/utf_string_conversions.h"
-#include "chrome/browser/extensions/extension_install_checker.h"
-#include "chrome/browser/extensions/extension_install_prompt.h"
-#include "chrome/browser/extensions/extension_util.h"
-#include "chrome/browser/profiles/profile.h"
-#include "chrome/browser/ui/browser_navigator.h"
-#include "chrome/browser/ui/browser_navigator_params.h"
-#include "chrome/browser/ui/extensions/app_launch_params.h"
-#include "chrome/browser/ui/extensions/application_launch.h"
-#include "chrome/browser/ui/extensions/extension_enable_flow.h"
-#include "chrome/browser/ui/native_window_tracker.h"
-#include "chrome/browser/ui/scoped_tabbed_browser_displayer.h"
-#include "chrome/common/chrome_switches.h"
-#include "chrome/common/extensions/manifest_handlers/app_launch_info.h"
-#include "content/public/browser/web_contents.h"
-#include "extensions/browser/extension_prefs.h"
-#include "extensions/browser/extension_registry.h"
-#include "extensions/browser/extension_system.h"
-#include "extensions/browser/management_policy.h"
-#include "extensions/common/constants.h"
-#include "extensions/common/permissions/permissions_data.h"
-#include "ui/app_list/app_list_switches.h"
-
-using content::WebContents;
-using extensions::Extension;
-using extensions::ExtensionInstallChecker;
-using extensions::ExtensionPrefs;
-using extensions::ExtensionRegistry;
-using extensions::ExtensionSystem;
-using extensions::ManagementPolicy;
-using extensions::WebstoreInstaller;
-namespace webstore_install = extensions::webstore_install;
-
-namespace {
-
-const char kInvalidManifestError[] = "Invalid manifest";
-const char kExtensionTypeError[] = "Not an app";
-const char kAppTypeError[] = "Ephemeral legacy packaged apps not supported";
-const char kUserCancelledError[] = "Launch cancelled by the user";
-const char kBlacklistedError[] = "App is blacklisted for malware";
-const char kRequirementsError[] = "App has missing requirements";
-const char kFeatureDisabledError[] = "Launching ephemeral apps is not enabled";
-const char kMissingAppError[] = "App is not installed";
-const char kAppDisabledError[] = "App is disabled";
-
-Profile* ProfileForWebContents(content::WebContents* contents) {
- if (!contents)
- return NULL;
-
- return Profile::FromBrowserContext(contents->GetBrowserContext());
-}
-
-gfx::NativeWindow NativeWindowForWebContents(content::WebContents* contents) {
- if (!contents)
- return NULL;
-
- return contents->GetTopLevelNativeWindow();
-}
-
-// Check whether an extension can be launched. The extension does not need to
-// be currently installed.
-bool CheckCommonLaunchCriteria(Profile* profile,
- const Extension* extension,
- webstore_install::Result* reason,
- std::string* error) {
- // Only apps can be launched.
- if (!extension->is_app()) {
- *reason = webstore_install::LAUNCH_UNSUPPORTED_EXTENSION_TYPE;
- *error = kExtensionTypeError;
- return false;
- }
-
- // Do not launch apps blocked by management policies.
- ManagementPolicy* management_policy =
- ExtensionSystem::Get(profile)->management_policy();
- base::string16 policy_error;
- if (!management_policy->UserMayLoad(extension, &policy_error)) {
- *reason = webstore_install::BLOCKED_BY_POLICY;
- *error = base::UTF16ToUTF8(policy_error);
- return false;
- }
-
- return true;
-}
-
-} // namespace
-
-// static
-bool EphemeralAppLauncher::IsFeatureEnabled() {
- return base::CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kEnableEphemeralAppsInWebstore);
-}
-
-// static
-scoped_refptr<EphemeralAppLauncher> EphemeralAppLauncher::CreateForLauncher(
- const std::string& webstore_item_id,
- Profile* profile,
- gfx::NativeWindow parent_window,
- const LaunchCallback& callback) {
- scoped_refptr<EphemeralAppLauncher> installer =
- new EphemeralAppLauncher(webstore_item_id,
- profile,
- parent_window,
- callback);
- installer->set_install_source(WebstoreInstaller::INSTALL_SOURCE_APP_LAUNCHER);
- return installer;
-}
-
-// static
-scoped_refptr<EphemeralAppLauncher> EphemeralAppLauncher::CreateForWebContents(
- const std::string& webstore_item_id,
- content::WebContents* web_contents,
- const LaunchCallback& callback) {
- scoped_refptr<EphemeralAppLauncher> installer =
- new EphemeralAppLauncher(webstore_item_id, web_contents, callback);
- installer->set_install_source(WebstoreInstaller::INSTALL_SOURCE_OTHER);
- return installer;
-}
-
-void EphemeralAppLauncher::Start() {
- if (!IsFeatureEnabled()) {
- InvokeCallback(webstore_install::LAUNCH_FEATURE_DISABLED,
- kFeatureDisabledError);
- return;
- }
-
- // Check whether the app already exists in extension system before downloading
- // from the webstore.
- const Extension* extension =
- ExtensionRegistry::Get(profile())
- ->GetExtensionById(id(), ExtensionRegistry::EVERYTHING);
- if (extension) {
- webstore_install::Result result = webstore_install::OTHER_ERROR;
- std::string error;
- if (!CanLaunchInstalledApp(extension, &result, &error)) {
- InvokeCallback(result, error);
- return;
- }
-
- if (extensions::util::IsAppLaunchableWithoutEnabling(extension->id(),
- profile())) {
- LaunchApp(extension);
- InvokeCallback(webstore_install::SUCCESS, std::string());
- return;
- }
-
- EnableInstalledApp(extension);
- return;
- }
-
- // Install the app ephemerally and launch when complete.
- BeginInstall();
-}
-
-EphemeralAppLauncher::EphemeralAppLauncher(const std::string& webstore_item_id,
- Profile* profile,
- gfx::NativeWindow parent_window,
- const LaunchCallback& callback)
- : WebstoreStandaloneInstaller(webstore_item_id, profile, Callback()),
- launch_callback_(callback),
- parent_window_(parent_window),
- dummy_web_contents_(
- WebContents::Create(WebContents::CreateParams(profile))) {
- if (parent_window_)
- parent_window_tracker_ = NativeWindowTracker::Create(parent_window);
-}
-
-EphemeralAppLauncher::EphemeralAppLauncher(const std::string& webstore_item_id,
- content::WebContents* web_contents,
- const LaunchCallback& callback)
- : WebstoreStandaloneInstaller(webstore_item_id,
- ProfileForWebContents(web_contents),
- Callback()),
- content::WebContentsObserver(web_contents),
- launch_callback_(callback),
- parent_window_(NativeWindowForWebContents(web_contents)) {
-}
-
-EphemeralAppLauncher::~EphemeralAppLauncher() {}
-
-scoped_ptr<extensions::ExtensionInstallChecker>
-EphemeralAppLauncher::CreateInstallChecker() {
- return make_scoped_ptr(new ExtensionInstallChecker(profile()));
-}
-
-scoped_ptr<ExtensionInstallPrompt> EphemeralAppLauncher::CreateInstallUI() {
- if (web_contents())
- return make_scoped_ptr(new ExtensionInstallPrompt(web_contents()));
-
- return make_scoped_ptr(new ExtensionInstallPrompt(profile(), parent_window_));
-}
-
-scoped_ptr<WebstoreInstaller::Approval> EphemeralAppLauncher::CreateApproval()
- const {
- scoped_ptr<WebstoreInstaller::Approval> approval =
- WebstoreStandaloneInstaller::CreateApproval();
- approval->is_ephemeral = true;
- return approval.Pass();
-}
-
-bool EphemeralAppLauncher::CanLaunchInstalledApp(
- const extensions::Extension* extension,
- webstore_install::Result* reason,
- std::string* error) {
- if (!CheckCommonLaunchCriteria(profile(), extension, reason, error))
- return false;
-
- // Do not launch blacklisted apps.
- if (ExtensionPrefs::Get(profile())->IsExtensionBlacklisted(extension->id())) {
- *reason = webstore_install::BLACKLISTED;
- *error = kBlacklistedError;
- return false;
- }
-
- // If the app has missing requirements, it cannot be launched.
- if (!extensions::util::IsAppLaunchable(extension->id(), profile())) {
- *reason = webstore_install::REQUIREMENT_VIOLATIONS;
- *error = kRequirementsError;
- return false;
- }
-
- return true;
-}
-
-void EphemeralAppLauncher::EnableInstalledApp(const Extension* extension) {
- // Check whether an install is already in progress.
- webstore_install::Result result = webstore_install::OTHER_ERROR;
- std::string error;
- if (!EnsureUniqueInstall(&result, &error)) {
- InvokeCallback(result, error);
- return;
- }
-
- // Keep this object alive until the enable flow is complete. Either
- // ExtensionEnableFlowFinished() or ExtensionEnableFlowAborted() will be
- // called.
- AddRef();
-
- extension_enable_flow_.reset(
- new ExtensionEnableFlow(profile(), extension->id(), this));
- if (web_contents())
- extension_enable_flow_->StartForWebContents(web_contents());
- else
- extension_enable_flow_->StartForNativeWindow(parent_window_);
-}
-
-void EphemeralAppLauncher::MaybeLaunchApp() {
- webstore_install::Result result = webstore_install::OTHER_ERROR;
- std::string error;
-
- ExtensionRegistry* registry = ExtensionRegistry::Get(profile());
- const Extension* extension =
- registry->GetExtensionById(id(), ExtensionRegistry::EVERYTHING);
- if (extension) {
- // Although the installation was successful, the app may not be
- // launchable.
- if (registry->enabled_extensions().Contains(extension->id())) {
- result = webstore_install::SUCCESS;
- LaunchApp(extension);
- } else {
- error = kAppDisabledError;
- // Determine why the app cannot be launched.
- CanLaunchInstalledApp(extension, &result, &error);
- }
- } else {
- // The extension must be present in the registry if installed.
- NOTREACHED();
- error = kMissingAppError;
- }
-
- InvokeCallback(result, error);
-}
-
-void EphemeralAppLauncher::LaunchApp(const Extension* extension) const {
- DCHECK(extension && extension->is_app() &&
- ExtensionRegistry::Get(profile())
- ->GetExtensionById(extension->id(), ExtensionRegistry::ENABLED));
-
- AppLaunchParams params(profile(), extension, NEW_FOREGROUND_TAB,
- extensions::SOURCE_EPHEMERAL_APP);
- params.desktop_type =
- chrome::GetHostDesktopTypeForNativeWindow(parent_window_);
- OpenApplication(params);
-}
-
-bool EphemeralAppLauncher::LaunchHostedApp(const Extension* extension) const {
- GURL launch_url = extensions::AppLaunchInfo::GetLaunchWebURL(extension);
- if (!launch_url.is_valid())
- return false;
-
- chrome::ScopedTabbedBrowserDisplayer displayer(
- profile(), chrome::GetHostDesktopTypeForNativeWindow(parent_window_));
- chrome::NavigateParams params(
- displayer.browser(), launch_url, ui::PAGE_TRANSITION_AUTO_TOPLEVEL);
- params.disposition = NEW_FOREGROUND_TAB;
- chrome::Navigate(&params);
- return true;
-}
-
-void EphemeralAppLauncher::InvokeCallback(webstore_install::Result result,
- const std::string& error) {
- if (!launch_callback_.is_null()) {
- LaunchCallback callback = launch_callback_;
- launch_callback_.Reset();
- callback.Run(result, error);
- }
-}
-
-void EphemeralAppLauncher::AbortLaunch(webstore_install::Result result,
- const std::string& error) {
- InvokeCallback(result, error);
- WebstoreStandaloneInstaller::CompleteInstall(result, error);
-}
-
-void EphemeralAppLauncher::CheckEphemeralInstallPermitted() {
- scoped_refptr<const Extension> extension = GetLocalizedExtensionForDisplay();
- DCHECK(extension.get()); // Checked in OnManifestParsed().
-
- install_checker_ = CreateInstallChecker();
- DCHECK(install_checker_.get());
-
- install_checker_->set_extension(extension);
- install_checker_->Start(ExtensionInstallChecker::CHECK_BLACKLIST |
- ExtensionInstallChecker::CHECK_REQUIREMENTS,
- true,
- base::Bind(&EphemeralAppLauncher::OnInstallChecked,
- base::Unretained(this)));
-}
-
-void EphemeralAppLauncher::OnInstallChecked(int check_failures) {
- if (!CheckRequestorAlive()) {
- AbortLaunch(webstore_install::OTHER_ERROR, std::string());
- return;
- }
-
- if (install_checker_->blacklist_state() == extensions::BLACKLISTED_MALWARE) {
- AbortLaunch(webstore_install::BLACKLISTED, kBlacklistedError);
- return;
- }
-
- if (!install_checker_->requirement_errors().empty()) {
- AbortLaunch(webstore_install::REQUIREMENT_VIOLATIONS,
- install_checker_->requirement_errors().front());
- return;
- }
-
- // Proceed with the normal install flow.
- ProceedWithInstallPrompt();
-}
-
-void EphemeralAppLauncher::InitInstallData(
- extensions::ActiveInstallData* install_data) const {
- install_data->is_ephemeral = true;
-}
-
-bool EphemeralAppLauncher::CheckRequestorAlive() const {
- if (!parent_window_) {
- // Assume the requestor is always alive if |parent_window_| is null.
- return true;
- }
-
- return (web_contents() != nullptr ||
- (parent_window_tracker_ &&
- !parent_window_tracker_->WasNativeWindowClosed()));
-}
-
-const GURL& EphemeralAppLauncher::GetRequestorURL() const {
- return GURL::EmptyGURL();
-}
-
-bool EphemeralAppLauncher::ShouldShowPostInstallUI() const {
- return false;
-}
-
-bool EphemeralAppLauncher::ShouldShowAppInstalledBubble() const {
- return false;
-}
-
-WebContents* EphemeralAppLauncher::GetWebContents() const {
- return web_contents() ? web_contents() : dummy_web_contents_.get();
-}
-
-scoped_refptr<ExtensionInstallPrompt::Prompt>
-EphemeralAppLauncher::CreateInstallPrompt() const {
- const Extension* extension = localized_extension_for_display();
- DCHECK(extension); // Checked in OnManifestParsed().
-
- // Skip the prompt by returning null if the app does not need to display
- // permission warnings.
- if (extension->permissions_data()->GetPermissionMessages().empty())
- return NULL;
-
- return make_scoped_refptr(new ExtensionInstallPrompt::Prompt(
- ExtensionInstallPrompt::LAUNCH_PROMPT));
-}
-
-bool EphemeralAppLauncher::CheckInlineInstallPermitted(
- const base::DictionaryValue& webstore_data,
- std::string* error) const {
- *error = "";
- return true;
-}
-
-bool EphemeralAppLauncher::CheckRequestorPermitted(
- const base::DictionaryValue& webstore_data,
- std::string* error) const {
- *error = "";
- return true;
-}
-
-void EphemeralAppLauncher::OnManifestParsed() {
- scoped_refptr<const Extension> extension = GetLocalizedExtensionForDisplay();
- if (!extension.get()) {
- AbortLaunch(webstore_install::INVALID_MANIFEST, kInvalidManifestError);
- return;
- }
-
- webstore_install::Result result = webstore_install::OTHER_ERROR;
- std::string error;
- if (!CheckCommonLaunchCriteria(profile(), extension.get(), &result, &error)) {
- AbortLaunch(result, error);
- return;
- }
-
- if (extension->is_legacy_packaged_app()) {
- AbortLaunch(webstore_install::LAUNCH_UNSUPPORTED_EXTENSION_TYPE,
- kAppTypeError);
- return;
- }
-
- if (extension->is_hosted_app()) {
- // Hosted apps do not need to be installed ephemerally. Just navigate to
- // their launch url.
- if (LaunchHostedApp(extension.get()))
- AbortLaunch(webstore_install::SUCCESS, std::string());
- else
- AbortLaunch(webstore_install::INVALID_MANIFEST, kInvalidManifestError);
- return;
- }
-
- CheckEphemeralInstallPermitted();
-}
-
-void EphemeralAppLauncher::CompleteInstall(webstore_install::Result result,
- const std::string& error) {
- if (result == webstore_install::SUCCESS)
- MaybeLaunchApp();
- else if (!launch_callback_.is_null())
- InvokeCallback(result, error);
-
- WebstoreStandaloneInstaller::CompleteInstall(result, error);
-}
-
-void EphemeralAppLauncher::WebContentsDestroyed() {
- launch_callback_.Reset();
- AbortInstall();
-}
-
-void EphemeralAppLauncher::ExtensionEnableFlowFinished() {
- MaybeLaunchApp();
-
- // CompleteInstall will call Release.
- WebstoreStandaloneInstaller::CompleteInstall(webstore_install::SUCCESS,
- std::string());
-}
-
-void EphemeralAppLauncher::ExtensionEnableFlowAborted(bool user_initiated) {
- // CompleteInstall will call Release.
- CompleteInstall(webstore_install::USER_CANCELLED, kUserCancelledError);
-}
diff --git a/chrome/browser/apps/ephemeral_app_launcher.h b/chrome/browser/apps/ephemeral_app_launcher.h
deleted file mode 100644
index 1ffab65..0000000
--- a/chrome/browser/apps/ephemeral_app_launcher.h
+++ /dev/null
@@ -1,157 +0,0 @@
-// Copyright 2013 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef CHROME_BROWSER_APPS_EPHEMERAL_APP_LAUNCHER_H_
-#define CHROME_BROWSER_APPS_EPHEMERAL_APP_LAUNCHER_H_
-
-#include <string>
-#include <vector>
-
-#include "base/basictypes.h"
-#include "base/callback.h"
-#include "base/scoped_observer.h"
-#include "chrome/browser/extensions/webstore_standalone_installer.h"
-#include "chrome/browser/ui/extensions/extension_enable_flow_delegate.h"
-#include "content/public/browser/web_contents_observer.h"
-
-class ExtensionEnableFlow;
-class NativeWindowTracker;
-class Profile;
-
-namespace content {
-class WebContents;
-}
-
-namespace extensions {
-class Extension;
-class ExtensionInstallChecker;
-class ExtensionRegistry;
-}
-
-// EphemeralAppLauncher manages the launching of ephemeral apps. It handles
-// display of a prompt, initiates install of the app (if necessary) and finally
-// launches the app.
-class EphemeralAppLauncher : public extensions::WebstoreStandaloneInstaller,
- public content::WebContentsObserver,
- public ExtensionEnableFlowDelegate {
- public:
- typedef base::Callback<void(extensions::webstore_install::Result result,
- const std::string& error)> LaunchCallback;
-
- // Returns true if launching ephemeral apps from the webstore is enabled.
- static bool IsFeatureEnabled();
-
- // Create for the app launcher.
- static scoped_refptr<EphemeralAppLauncher> CreateForLauncher(
- const std::string& webstore_item_id,
- Profile* profile,
- gfx::NativeWindow parent_window,
- const LaunchCallback& callback);
-
- // Create for a web contents.
- static scoped_refptr<EphemeralAppLauncher> CreateForWebContents(
- const std::string& webstore_item_id,
- content::WebContents* web_contents,
- const LaunchCallback& callback);
-
- // Initiate app launch.
- void Start();
-
- protected:
- EphemeralAppLauncher(const std::string& webstore_item_id,
- Profile* profile,
- gfx::NativeWindow parent_window,
- const LaunchCallback& callback);
- EphemeralAppLauncher(const std::string& webstore_item_id,
- content::WebContents* web_contents,
- const LaunchCallback& callback);
-
- ~EphemeralAppLauncher() override;
-
- // Creates an install checker. Allows tests to mock the install checker.
- virtual scoped_ptr<extensions::ExtensionInstallChecker>
- CreateInstallChecker();
-
- // WebstoreStandaloneInstaller implementation overridden in tests.
- scoped_ptr<ExtensionInstallPrompt> CreateInstallUI() override;
- scoped_ptr<extensions::WebstoreInstaller::Approval> CreateApproval()
- const override;
-
- private:
- friend class base::RefCountedThreadSafe<EphemeralAppLauncher>;
- friend class EphemeralAppLauncherTest;
-
- // Returns true if an app that is already installed in extension system can
- // be launched.
- bool CanLaunchInstalledApp(const extensions::Extension* extension,
- extensions::webstore_install::Result* reason,
- std::string* error);
-
- // Initiates the enable flow for an app before it can be launched.
- void EnableInstalledApp(const extensions::Extension* extension);
-
- // After the ephemeral installation or enable flow are complete, attempts to
- // launch the app and notify the client of the outcome.
- void MaybeLaunchApp();
-
- // Launches an app. At this point, it is assumed that the app is enabled and
- // can be launched.
- void LaunchApp(const extensions::Extension* extension) const;
-
- // Navigates to the launch URL of a hosted app in a new browser tab.
- bool LaunchHostedApp(const extensions::Extension* extension) const;
-
- // Notifies the client of the launch outcome.
- void InvokeCallback(extensions::webstore_install::Result result,
- const std::string& error);
-
- // Aborts the ephemeral install and notifies the client of the outcome.
- void AbortLaunch(extensions::webstore_install::Result result,
- const std::string& error);
-
- // Determines whether the app can be installed ephemerally.
- void CheckEphemeralInstallPermitted();
-
- // Install checker callback.
- void OnInstallChecked(int check_failures);
-
- // WebstoreStandaloneInstaller implementation.
- void InitInstallData(
- extensions::ActiveInstallData* install_data) const override;
- bool CheckRequestorAlive() const override;
- const GURL& GetRequestorURL() const override;
- bool ShouldShowPostInstallUI() const override;
- bool ShouldShowAppInstalledBubble() const override;
- content::WebContents* GetWebContents() const override;
- scoped_refptr<ExtensionInstallPrompt::Prompt> CreateInstallPrompt()
- const override;
- bool CheckInlineInstallPermitted(const base::DictionaryValue& webstore_data,
- std::string* error) const override;
- bool CheckRequestorPermitted(const base::DictionaryValue& webstore_data,
- std::string* error) const override;
- void OnManifestParsed() override;
- void CompleteInstall(extensions::webstore_install::Result result,
- const std::string& error) override;
-
- // content::WebContentsObserver implementation.
- void WebContentsDestroyed() override;
-
- // ExtensionEnableFlowDelegate implementation.
- void ExtensionEnableFlowFinished() override;
- void ExtensionEnableFlowAborted(bool user_initiated) override;
-
- LaunchCallback launch_callback_;
-
- gfx::NativeWindow parent_window_;
- scoped_ptr<NativeWindowTracker> parent_window_tracker_;
- scoped_ptr<content::WebContents> dummy_web_contents_;
-
- scoped_ptr<ExtensionEnableFlow> extension_enable_flow_;
-
- scoped_ptr<extensions::ExtensionInstallChecker> install_checker_;
-
- DISALLOW_COPY_AND_ASSIGN(EphemeralAppLauncher);
-};
-
-#endif // CHROME_BROWSER_APPS_EPHEMERAL_APP_LAUNCHER_H_
diff --git a/chrome/browser/apps/ephemeral_app_launcher_browsertest.cc b/chrome/browser/apps/ephemeral_app_launcher_browsertest.cc
deleted file mode 100644
index fbeb7f8..0000000
--- a/chrome/browser/apps/ephemeral_app_launcher_browsertest.cc
+++ /dev/null
@@ -1,563 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "base/thread_task_runner_handle.h"
-#include "chrome/browser/apps/ephemeral_app_launcher.h"
-#include "chrome/browser/apps/ephemeral_app_service.h"
-#include "chrome/browser/extensions/extension_install_checker.h"
-#include "chrome/browser/extensions/extension_service.h"
-#include "chrome/browser/extensions/install_tracker.h"
-#include "chrome/browser/extensions/test_blacklist.h"
-#include "chrome/browser/extensions/webstore_installer_test.h"
-#include "chrome/browser/ui/browser_finder.h"
-#include "chrome/browser/ui/tabs/tab_strip_model.h"
-#include "chrome/common/chrome_switches.h"
-#include "content/public/browser/web_contents.h"
-#include "content/public/test/test_utils.h"
-#include "extensions/browser/extension_prefs.h"
-#include "extensions/browser/extension_registry.h"
-#include "extensions/browser/extension_system.h"
-#include "extensions/browser/extension_util.h"
-#include "extensions/browser/management_policy.h"
-#include "extensions/browser/process_manager.h"
-#include "extensions/browser/test_extension_registry_observer.h"
-#include "extensions/test/extension_test_message_listener.h"
-
-using extensions::Extension;
-using extensions::ExtensionPrefs;
-using extensions::ExtensionRegistry;
-using extensions::ExtensionSystem;
-using extensions::InstallTracker;
-namespace webstore_install = extensions::webstore_install;
-
-namespace {
-
-const char kWebstoreDomain[] = "cws.com";
-const char kAppDomain[] = "app.com";
-const char kNonAppDomain[] = "nonapp.com";
-const char kTestDataPath[] = "extensions/platform_apps/ephemeral_launcher";
-
-const char kExtensionId[] = "eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeid";
-const char kExtensionTestPath[] = "extension";
-const char kLegacyAppId[] = "lnbochkobjfnhbnbljgfgokadhmbahcn";
-const char kLegacyAppTestPath[] = "legacy_app";
-const char kNonExistentId[] = "baaaaaaaaaaaaaaaaaaaaaaaaaaaadid";
-const char kDefaultAppId[] = "kbiancnbopdghkfedjhfdoegjadfjeal";
-const char kDefaultAppCrxFilename[] = "app.crx";
-const char kDefaultAppTestPath[] = "app";
-const char kAppWithPermissionsId[] = "mbfcnecjknjpipkfkoangpfnhhlpamki";
-const char kAppWithPermissionsFilename[] = "app_with_permissions.crx";
-const char kHostedAppId[] = "haaaaaaaaaaaaaaaaaaaaaaaaaaappid";
-const char kHostedAppLaunchUrl[] = "http://foo.bar.com";
-
-class ExtensionInstallCheckerMock : public extensions::ExtensionInstallChecker {
- public:
- ExtensionInstallCheckerMock(Profile* profile,
- const std::string& requirements_error)
- : extensions::ExtensionInstallChecker(profile),
- requirements_error_(requirements_error) {}
-
- ~ExtensionInstallCheckerMock() override {}
-
- private:
- void CheckRequirements() override {
- // Simulate an asynchronous operation.
- base::ThreadTaskRunnerHandle::Get()->PostTask(
- FROM_HERE,
- base::Bind(&ExtensionInstallCheckerMock::RequirementsErrorCheckDone,
- base::Unretained(this), current_sequence_number()));
- }
-
- void RequirementsErrorCheckDone(int sequence_number) {
- std::vector<std::string> errors;
- errors.push_back(requirements_error_);
- OnRequirementsCheckDone(sequence_number, errors);
- }
-
- std::string requirements_error_;
-};
-
-class EphemeralAppLauncherForTest : public EphemeralAppLauncher {
- public:
- EphemeralAppLauncherForTest(const std::string& id,
- Profile* profile,
- const LaunchCallback& callback)
- : EphemeralAppLauncher(id, profile, NULL, callback),
- install_initiated_(false),
- install_prompt_created_(false) {}
-
- EphemeralAppLauncherForTest(const std::string& id, Profile* profile)
- : EphemeralAppLauncher(id, profile, NULL, LaunchCallback()),
- install_initiated_(false),
- install_prompt_created_(false) {}
-
- bool install_initiated() const { return install_initiated_; }
- bool install_prompt_created() const { return install_prompt_created_; }
-
- void set_requirements_error(const std::string& error) {
- requirements_check_error_ = error;
- }
-
- private:
- // Override necessary functions for testing.
-
- scoped_ptr<extensions::ExtensionInstallChecker> CreateInstallChecker()
- override {
- if (requirements_check_error_.empty()) {
- return EphemeralAppLauncher::CreateInstallChecker();
- } else {
- return scoped_ptr<extensions::ExtensionInstallChecker>(
- new ExtensionInstallCheckerMock(profile(),
- requirements_check_error_));
- }
- }
-
- scoped_ptr<ExtensionInstallPrompt> CreateInstallUI() override {
- install_prompt_created_ = true;
- return EphemeralAppLauncher::CreateInstallUI();
- }
-
- scoped_ptr<extensions::WebstoreInstaller::Approval> CreateApproval()
- const override {
- install_initiated_ = true;
- return EphemeralAppLauncher::CreateApproval();
- }
-
- private:
- ~EphemeralAppLauncherForTest() override {}
- friend class base::RefCountedThreadSafe<EphemeralAppLauncherForTest>;
-
- mutable bool install_initiated_;
- std::string requirements_check_error_;
- bool install_prompt_created_;
-};
-
-class LaunchObserver {
- public:
- LaunchObserver()
- : done_(false),
- waiting_(false),
- result_(webstore_install::OTHER_ERROR) {}
-
- webstore_install::Result result() const { return result_; }
- const std::string& error() const { return error_; }
-
- void OnLaunchCallback(webstore_install::Result result,
- const std::string& error) {
- result_ = result;
- error_ = error;
- done_ = true;
- if (waiting_) {
- waiting_ = false;
- base::MessageLoopForUI::current()->QuitWhenIdle();
- }
- }
-
- void Wait() {
- if (done_)
- return;
-
- waiting_ = true;
- content::RunMessageLoop();
- }
-
- private:
- bool done_;
- bool waiting_;
- webstore_install::Result result_;
- std::string error_;
-};
-
-class ManagementPolicyMock : public extensions::ManagementPolicy::Provider {
- public:
- ManagementPolicyMock() {}
-
- std::string GetDebugPolicyProviderName() const override {
- return "ManagementPolicyMock";
- }
-
- bool UserMayLoad(const Extension* extension,
- base::string16* error) const override {
- return false;
- }
-};
-
-} // namespace
-
-class EphemeralAppLauncherTest : public WebstoreInstallerTest {
- public:
- EphemeralAppLauncherTest()
- : WebstoreInstallerTest(kWebstoreDomain,
- kTestDataPath,
- kDefaultAppCrxFilename,
- kAppDomain,
- kNonAppDomain) {}
-
- void SetUpCommandLine(base::CommandLine* command_line) override {
- WebstoreInstallerTest::SetUpCommandLine(command_line);
-
- // Make event pages get suspended immediately.
- extensions::ProcessManager::SetEventPageIdleTimeForTesting(1);
- extensions::ProcessManager::SetEventPageSuspendingTimeForTesting(1);
-
- // Enable ephemeral apps flag.
- command_line->AppendSwitch(switches::kEnableEphemeralAppsInWebstore);
- }
-
- void SetUpOnMainThread() override {
- WebstoreInstallerTest::SetUpOnMainThread();
-
- // Disable ephemeral apps immediately after they stop running in tests.
- EphemeralAppService::Get(profile())->set_disable_delay_for_test(0);
- }
-
- base::FilePath GetTestPath(const char* test_name) {
- return test_data_dir_.AppendASCII("platform_apps/ephemeral_launcher")
- .AppendASCII(test_name);
- }
-
- const Extension* GetInstalledExtension(const std::string& id) {
- return ExtensionRegistry::Get(profile())
- ->GetExtensionById(id, ExtensionRegistry::EVERYTHING);
- }
-
- void SetCrxFilename(const std::string& filename) {
- GURL crx_url = GenerateTestServerUrl(kWebstoreDomain, filename);
- base::CommandLine::ForCurrentProcess()->AppendSwitchASCII(
- switches::kAppsGalleryUpdateURL, crx_url.spec());
- }
-
- void StartLauncherAndCheckResult(EphemeralAppLauncherForTest* launcher,
- webstore_install::Result expected_result,
- bool expect_install_initiated) {
- ExtensionTestMessageListener launched_listener("launched", false);
- LaunchObserver launch_observer;
-
- launcher->launch_callback_ = base::Bind(&LaunchObserver::OnLaunchCallback,
- base::Unretained(&launch_observer));
- launcher->Start();
- launch_observer.Wait();
-
- // Verify the launch result.
- EXPECT_EQ(expected_result, launch_observer.result());
- EXPECT_EQ(expect_install_initiated, launcher->install_initiated());
-
- // Verify that the app was actually launched if the launcher succeeded.
- if (launch_observer.result() == webstore_install::SUCCESS)
- EXPECT_TRUE(launched_listener.WaitUntilSatisfied());
- else
- EXPECT_FALSE(launched_listener.was_satisfied());
-
- // Check the reference count to ensure the launcher instance will not be
- // leaked.
- EXPECT_TRUE(launcher->HasOneRef());
- }
-
- void RunLaunchTest(const std::string& id,
- webstore_install::Result expected_result,
- bool expect_install_initiated) {
- InstallTracker* tracker = InstallTracker::Get(profile());
- ASSERT_TRUE(tracker);
- bool was_install_active = !!tracker->GetActiveInstall(id);
-
- scoped_refptr<EphemeralAppLauncherForTest> launcher(
- new EphemeralAppLauncherForTest(id, profile()));
- StartLauncherAndCheckResult(
- launcher.get(), expected_result, expect_install_initiated);
-
- // Verify that the install was deregistered from the InstallTracker.
- EXPECT_EQ(was_install_active, !!tracker->GetActiveInstall(id));
- }
-
- void ValidateAppInstalledEphemerally(const std::string& id) {
- EXPECT_TRUE(GetInstalledExtension(id));
- EXPECT_TRUE(extensions::util::IsEphemeralApp(id, profile()));
- }
-
- const Extension* InstallAndDisableApp(
- const char* test_path,
- Extension::DisableReason disable_reason) {
- const Extension* app = InstallExtension(GetTestPath(test_path), 1);
- EXPECT_TRUE(app);
- if (!app)
- return NULL;
-
- ExtensionService* service =
- ExtensionSystem::Get(profile())->extension_service();
- service->DisableExtension(app->id(), disable_reason);
-
- EXPECT_TRUE(
- ExtensionRegistry::Get(profile())->disabled_extensions().Contains(
- app->id()));
- return app;
- }
-};
-
-class EphemeralAppLauncherTestDisabled : public EphemeralAppLauncherTest {
- public:
- void SetUpCommandLine(base::CommandLine* command_line) override {
- // Skip EphemeralAppLauncherTest as it enables the feature.
- WebstoreInstallerTest::SetUpCommandLine(command_line);
- }
-};
-
-// Verifies that an ephemeral app will not be installed and launched if the
-// feature is disabled.
-IN_PROC_BROWSER_TEST_F(EphemeralAppLauncherTestDisabled, FeatureDisabled) {
- RunLaunchTest(
- kDefaultAppCrxFilename, webstore_install::LAUNCH_FEATURE_DISABLED, false);
- EXPECT_FALSE(GetInstalledExtension(kDefaultAppId));
-}
-
-// Verifies that an app with no permission warnings will be installed
-// ephemerally and launched without prompting the user.
-IN_PROC_BROWSER_TEST_F(EphemeralAppLauncherTest,
- LaunchAppWithNoPermissionWarnings) {
- extensions::TestExtensionRegistryObserver observer(
- ExtensionRegistry::Get(profile()));
-
- scoped_refptr<EphemeralAppLauncherForTest> launcher(
- new EphemeralAppLauncherForTest(kDefaultAppId, profile()));
- StartLauncherAndCheckResult(launcher.get(), webstore_install::SUCCESS, true);
- ValidateAppInstalledEphemerally(kDefaultAppId);
-
- // Apps with no permission warnings should not result in a prompt.
- EXPECT_FALSE(launcher->install_prompt_created());
-
- // Ephemeral apps are unloaded after they stop running.
- observer.WaitForExtensionUnloaded();
-
- // After an app has been installed ephemerally, it can be launched again
- // without installing from the web store.
- RunLaunchTest(kDefaultAppId, webstore_install::SUCCESS, false);
-}
-
-// Verifies that an app with permission warnings will be installed
-// ephemerally and launched if accepted by the user.
-IN_PROC_BROWSER_TEST_F(EphemeralAppLauncherTest,
- LaunchAppWithPermissionsWarnings) {
- SetCrxFilename(kAppWithPermissionsFilename);
- AutoAcceptInstall();
-
- scoped_refptr<EphemeralAppLauncherForTest> launcher(
- new EphemeralAppLauncherForTest(kAppWithPermissionsId, profile()));
- StartLauncherAndCheckResult(launcher.get(), webstore_install::SUCCESS, true);
- ValidateAppInstalledEphemerally(kAppWithPermissionsId);
- EXPECT_TRUE(launcher->install_prompt_created());
-}
-
-// Verifies that an app with permission warnings will not be installed
-// ephemerally if cancelled by the user.
-IN_PROC_BROWSER_TEST_F(EphemeralAppLauncherTest,
- CancelInstallAppWithPermissionWarnings) {
- SetCrxFilename(kAppWithPermissionsFilename);
- AutoCancelInstall();
-
- scoped_refptr<EphemeralAppLauncherForTest> launcher(
- new EphemeralAppLauncherForTest(kAppWithPermissionsId, profile()));
- StartLauncherAndCheckResult(
- launcher.get(), webstore_install::USER_CANCELLED, false);
- EXPECT_FALSE(GetInstalledExtension(kAppWithPermissionsId));
- EXPECT_TRUE(launcher->install_prompt_created());
-}
-
-// Verifies that an extension will not be installed ephemerally.
-IN_PROC_BROWSER_TEST_F(EphemeralAppLauncherTest, InstallExtension) {
- RunLaunchTest(
- kExtensionId, webstore_install::LAUNCH_UNSUPPORTED_EXTENSION_TYPE, false);
- EXPECT_FALSE(GetInstalledExtension(kExtensionId));
-}
-
-// Verifies that an already installed extension will not be launched.
-IN_PROC_BROWSER_TEST_F(EphemeralAppLauncherTest, LaunchExtension) {
- const Extension* extension =
- InstallExtension(GetTestPath(kExtensionTestPath), 1);
- ASSERT_TRUE(extension);
- RunLaunchTest(extension->id(),
- webstore_install::LAUNCH_UNSUPPORTED_EXTENSION_TYPE,
- false);
-}
-
-// Verifies that a legacy packaged app will not be installed ephemerally.
-IN_PROC_BROWSER_TEST_F(EphemeralAppLauncherTest, InstallLegacyApp) {
- RunLaunchTest(
- kLegacyAppId, webstore_install::LAUNCH_UNSUPPORTED_EXTENSION_TYPE, false);
- EXPECT_FALSE(GetInstalledExtension(kLegacyAppId));
-}
-
-// Verifies that a legacy packaged app that is already installed can be
-// launched.
-IN_PROC_BROWSER_TEST_F(EphemeralAppLauncherTest, LaunchLegacyApp) {
- const Extension* extension =
- InstallExtension(GetTestPath(kLegacyAppTestPath), 1);
- ASSERT_TRUE(extension);
- RunLaunchTest(extension->id(), webstore_install::SUCCESS, false);
-}
-
-// Verifies that a hosted app is not installed. Launch succeeds because we
-// navigate to its launch url.
-IN_PROC_BROWSER_TEST_F(EphemeralAppLauncherTest, LaunchHostedApp) {
- LaunchObserver launch_observer;
-
- scoped_refptr<EphemeralAppLauncherForTest> launcher(
- new EphemeralAppLauncherForTest(
- kHostedAppId,
- profile(),
- base::Bind(&LaunchObserver::OnLaunchCallback,
- base::Unretained(&launch_observer))));
- launcher->Start();
- launch_observer.Wait();
-
- EXPECT_EQ(webstore_install::SUCCESS, launch_observer.result());
- EXPECT_FALSE(launcher->install_initiated());
- EXPECT_FALSE(GetInstalledExtension(kHostedAppId));
-
- // Verify that a navigation to the launch url was attempted.
- Browser* browser =
- FindBrowserWithProfile(profile(), chrome::GetActiveDesktop());
- ASSERT_TRUE(browser);
- content::WebContents* web_contents =
- browser->tab_strip_model()->GetActiveWebContents();
- ASSERT_TRUE(web_contents);
- EXPECT_EQ(GURL(kHostedAppLaunchUrl), web_contents->GetVisibleURL());
-}
-
-// Verifies that the EphemeralAppLauncher handles non-existent extension ids.
-IN_PROC_BROWSER_TEST_F(EphemeralAppLauncherTest, NonExistentExtensionId) {
- RunLaunchTest(
- kNonExistentId, webstore_install::WEBSTORE_REQUEST_ERROR, false);
- EXPECT_FALSE(GetInstalledExtension(kNonExistentId));
-}
-
-// Verifies that an app blocked by management policy is not installed
-// ephemerally.
-IN_PROC_BROWSER_TEST_F(EphemeralAppLauncherTest, BlockedByPolicy) {
- // Register a provider that blocks the installation of all apps.
- ManagementPolicyMock policy;
- ExtensionSystem::Get(profile())->management_policy()->RegisterProvider(
- &policy);
-
- RunLaunchTest(kDefaultAppId, webstore_install::BLOCKED_BY_POLICY, false);
- EXPECT_FALSE(GetInstalledExtension(kDefaultAppId));
-}
-
-// The blacklist relies on safe-browsing database infrastructure.
-#if defined(SAFE_BROWSING_DB_LOCAL)
-// Verifies that an app blacklisted for malware is not installed ephemerally.
-IN_PROC_BROWSER_TEST_F(EphemeralAppLauncherTest, BlacklistedForMalware) {
- // Mock a BLACKLISTED_MALWARE return status.
- extensions::TestBlacklist blacklist_tester(
- extensions::Blacklist::Get(profile()));
- blacklist_tester.SetBlacklistState(
- kDefaultAppId, extensions::BLACKLISTED_MALWARE, false);
-
- RunLaunchTest(kDefaultAppId, webstore_install::BLACKLISTED, false);
- EXPECT_FALSE(GetInstalledExtension(kDefaultAppId));
-}
-
-// Verifies that an app with unknown blacklist status is installed ephemerally
-// and launched.
-IN_PROC_BROWSER_TEST_F(EphemeralAppLauncherTest, BlacklistStateUnknown) {
- // Mock a BLACKLISTED_MALWARE return status.
- extensions::TestBlacklist blacklist_tester(
- extensions::Blacklist::Get(profile()));
- blacklist_tester.SetBlacklistState(
- kDefaultAppId, extensions::BLACKLISTED_UNKNOWN, false);
-
- RunLaunchTest(kDefaultAppId, webstore_install::SUCCESS, true);
- ValidateAppInstalledEphemerally(kDefaultAppId);
-}
-#endif
-
-// Verifies that an app with unsupported requirements is not installed
-// ephemerally.
-IN_PROC_BROWSER_TEST_F(EphemeralAppLauncherTest, UnsupportedRequirements) {
- scoped_refptr<EphemeralAppLauncherForTest> launcher(
- new EphemeralAppLauncherForTest(kDefaultAppId, profile()));
- launcher->set_requirements_error("App has unsupported requirements");
-
- StartLauncherAndCheckResult(
- launcher.get(), webstore_install::REQUIREMENT_VIOLATIONS, false);
- EXPECT_FALSE(GetInstalledExtension(kDefaultAppId));
-}
-
-// Verifies that an app disabled due to permissions increase can be enabled
-// and launched.
-IN_PROC_BROWSER_TEST_F(EphemeralAppLauncherTest, EnableAndLaunchApp) {
- const Extension* app = InstallAndDisableApp(
- kDefaultAppTestPath, Extension::DISABLE_PERMISSIONS_INCREASE);
- ASSERT_TRUE(app);
-
- AutoAcceptInstall();
- RunLaunchTest(app->id(), webstore_install::SUCCESS, false);
-}
-
-// Verifies that if the user cancels the enable flow, the app will not be
-// enabled and launched.
-IN_PROC_BROWSER_TEST_F(EphemeralAppLauncherTest, EnableCancelled) {
- const Extension* app = InstallAndDisableApp(
- kDefaultAppTestPath, Extension::DISABLE_PERMISSIONS_INCREASE);
- ASSERT_TRUE(app);
-
- AutoCancelInstall();
- RunLaunchTest(app->id(), webstore_install::USER_CANCELLED, false);
-}
-
-// Verifies that an installed app that had been blocked by policy cannot be
-// launched.
-IN_PROC_BROWSER_TEST_F(EphemeralAppLauncherTest, LaunchAppBlockedByPolicy) {
- const Extension* app = InstallExtension(GetTestPath(kDefaultAppTestPath), 1);
- ASSERT_TRUE(app);
-
- // Simulate blocking of the app after it has been installed.
- ManagementPolicyMock policy;
- ExtensionSystem::Get(profile())->management_policy()->RegisterProvider(
- &policy);
- ExtensionSystem::Get(profile())->extension_service()->CheckManagementPolicy();
-
- RunLaunchTest(app->id(), webstore_install::BLOCKED_BY_POLICY, false);
-}
-
-// Verifies that an installed blacklisted app cannot be launched.
-IN_PROC_BROWSER_TEST_F(EphemeralAppLauncherTest, LaunchBlacklistedApp) {
- const Extension* app = InstallExtension(GetTestPath(kDefaultAppTestPath), 1);
- ASSERT_TRUE(app);
-
- ExtensionService* service =
- ExtensionSystem::Get(profile())->extension_service();
- service->BlacklistExtensionForTest(app->id());
- ASSERT_TRUE(
- ExtensionRegistry::Get(profile())->blacklisted_extensions().Contains(
- app->id()));
-
- RunLaunchTest(app->id(), webstore_install::BLACKLISTED, false);
-}
-
-// Verifies that an installed app with unsupported requirements cannot be
-// launched.
-IN_PROC_BROWSER_TEST_F(EphemeralAppLauncherTest,
- LaunchAppWithUnsupportedRequirements) {
- const Extension* app = InstallAndDisableApp(
- kDefaultAppTestPath, Extension::DISABLE_UNSUPPORTED_REQUIREMENT);
- ASSERT_TRUE(app);
-
- RunLaunchTest(app->id(), webstore_install::REQUIREMENT_VIOLATIONS, false);
-}
-
-// Verifies that a launch will fail if the app is currently being installed.
-IN_PROC_BROWSER_TEST_F(EphemeralAppLauncherTest, InstallInProgress) {
- extensions::ActiveInstallData install_data(kDefaultAppId);
- InstallTracker::Get(profile())->AddActiveInstall(install_data);
-
- RunLaunchTest(kDefaultAppId, webstore_install::INSTALL_IN_PROGRESS, false);
-}
-
-// Verifies that a launch will fail if a duplicate launch is in progress.
-IN_PROC_BROWSER_TEST_F(EphemeralAppLauncherTest, DuplicateLaunchInProgress) {
- extensions::ActiveInstallData install_data(kDefaultAppId);
- install_data.is_ephemeral = true;
- InstallTracker::Get(profile())->AddActiveInstall(install_data);
-
- RunLaunchTest(kDefaultAppId, webstore_install::LAUNCH_IN_PROGRESS, false);
-}
diff --git a/chrome/browser/extensions/active_install_data.cc b/chrome/browser/extensions/active_install_data.cc
index f9c9a0c..ee6cdfe 100644
--- a/chrome/browser/extensions/active_install_data.cc
+++ b/chrome/browser/extensions/active_install_data.cc
@@ -11,11 +11,11 @@ namespace extensions {
// ActiveInstallData:
ActiveInstallData::ActiveInstallData()
- : percent_downloaded(0), is_ephemeral(false) {
+ : percent_downloaded(0) {
}
ActiveInstallData::ActiveInstallData(const std::string& extension_id)
- : extension_id(extension_id), percent_downloaded(0), is_ephemeral(false) {
+ : extension_id(extension_id), percent_downloaded(0) {
}
// ScopedActiveInstall:
diff --git a/chrome/browser/extensions/active_install_data.h b/chrome/browser/extensions/active_install_data.h
index 4aa5887..c7dd9ba 100644
--- a/chrome/browser/extensions/active_install_data.h
+++ b/chrome/browser/extensions/active_install_data.h
@@ -23,7 +23,6 @@ struct ActiveInstallData {
std::string extension_id;
int percent_downloaded;
- bool is_ephemeral;
};
// Registers and deregisters and an active extension install with the
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 11e64a9..f127643 100644
--- a/chrome/browser/extensions/api/webstore_private/webstore_private_api.cc
+++ b/chrome/browser/extensions/api/webstore_private/webstore_private_api.cc
@@ -14,7 +14,6 @@
#include "base/thread_task_runner_handle.h"
#include "base/values.h"
#include "base/version.h"
-#include "chrome/browser/apps/ephemeral_app_launcher.h"
#include "chrome/browser/bitmap_fetcher/bitmap_fetcher.h"
#include "chrome/browser/extensions/crx_installer.h"
#include "chrome/browser/extensions/extension_install_ui_util.h"
@@ -100,46 +99,6 @@ chrome::HostDesktopType GetHostDesktopTypeForWebContents(
contents->GetTopLevelNativeWindow());
}
-api::webstore_private::Result WebstoreInstallResultToApiResult(
- webstore_install::Result result) {
- switch (result) {
- case webstore_install::SUCCESS:
- return api::webstore_private::RESULT_SUCCESS;
- case webstore_install::OTHER_ERROR:
- return api::webstore_private::RESULT_UNKNOWN_ERROR;
- case webstore_install::INVALID_ID:
- return api::webstore_private::RESULT_INVALID_ID;
- case webstore_install::NOT_PERMITTED:
- case webstore_install::WEBSTORE_REQUEST_ERROR:
- case webstore_install::INVALID_WEBSTORE_RESPONSE:
- return api::webstore_private::RESULT_INSTALL_ERROR;
- case webstore_install::INVALID_MANIFEST:
- return api::webstore_private::RESULT_MANIFEST_ERROR;
- case webstore_install::ICON_ERROR:
- return api::webstore_private::RESULT_ICON_ERROR;
- case webstore_install::ABORTED:
- case webstore_install::USER_CANCELLED:
- return api::webstore_private::RESULT_USER_CANCELLED;
- case webstore_install::BLACKLISTED:
- return api::webstore_private::RESULT_BLACKLISTED;
- case webstore_install::MISSING_DEPENDENCIES:
- case webstore_install::REQUIREMENT_VIOLATIONS:
- return api::webstore_private::RESULT_MISSING_DEPENDENCIES;
- case webstore_install::BLOCKED_BY_POLICY:
- return api::webstore_private::RESULT_BLOCKED_BY_POLICY;
- case webstore_install::LAUNCH_FEATURE_DISABLED:
- return api::webstore_private::RESULT_FEATURE_DISABLED;
- case webstore_install::LAUNCH_UNSUPPORTED_EXTENSION_TYPE:
- return api::webstore_private::RESULT_UNSUPPORTED_EXTENSION_TYPE;
- case webstore_install::INSTALL_IN_PROGRESS:
- return api::webstore_private::RESULT_INSTALL_IN_PROGRESS;
- case webstore_install::LAUNCH_IN_PROGRESS:
- return api::webstore_private::RESULT_LAUNCH_IN_PROGRESS;
- }
- NOTREACHED();
- return api::webstore_private::RESULT_NONE;
-}
-
api::webstore_private::Result WebstoreInstallHelperResultToApiResult(
WebstoreInstallHelper::Delegate::InstallHelperResultCode result) {
switch (result) {
@@ -174,6 +133,8 @@ const char kNoPreviousBeginInstallWithManifestError[] =
const char kUserCancelledError[] = "User cancelled install";
const char kIncognitoError[] =
"Apps cannot be installed in guest/incognito mode";
+const char kEphemeralAppLaunchingNotSupported[] =
+ "Ephemeral launching of apps is no longer supported.";
WebstoreInstaller::Delegate* test_webstore_installer_delegate = nullptr;
@@ -746,60 +707,8 @@ WebstorePrivateLaunchEphemeralAppFunction::
ExtensionFunction::ResponseAction
WebstorePrivateLaunchEphemeralAppFunction::Run() {
- // Check whether the browser window still exists.
- content::WebContents* web_contents =
- chrome_details_.GetAssociatedWebContents();
- if (!web_contents)
- return RespondNow(Error("aborted"));
-
- if (!user_gesture()) {
- return RespondNow(BuildResponse(
- api::webstore_private::RESULT_USER_GESTURE_REQUIRED,
- "User gesture is required"));
- }
-
- scoped_ptr<LaunchEphemeralApp::Params> params(
- LaunchEphemeralApp::Params::Create(*args_));
- EXTENSION_FUNCTION_VALIDATE(params);
-
- AddRef(); // Balanced in OnLaunchComplete()
-
- scoped_refptr<EphemeralAppLauncher> launcher =
- EphemeralAppLauncher::CreateForWebContents(
- params->id,
- web_contents,
- base::Bind(
- &WebstorePrivateLaunchEphemeralAppFunction::OnLaunchComplete,
- base::Unretained(this)));
- launcher->Start();
-
- return RespondLater();
-}
-
-void WebstorePrivateLaunchEphemeralAppFunction::OnLaunchComplete(
- webstore_install::Result result, const std::string& error) {
- Respond(BuildResponse(WebstoreInstallResultToApiResult(result), error));
- Release(); // Matches AddRef() in Run()
-}
-
-ExtensionFunction::ResponseValue
-WebstorePrivateLaunchEphemeralAppFunction::BuildResponse(
- api::webstore_private::Result result, const std::string& error) {
- if (result != api::webstore_private::RESULT_SUCCESS) {
- std::string error_message;
- if (error.empty()) {
- error_message = base::StringPrintf(
- "[%s]", api::webstore_private::ToString(result).c_str());
- } else {
- error_message = base::StringPrintf(
- "[%s]: %s",
- api::webstore_private::ToString(result).c_str(),
- error.c_str());
- }
- return ErrorWithArguments(LaunchEphemeralApp::Results::Create(result),
- error_message);
- }
- return ArgumentList(LaunchEphemeralApp::Results::Create(result));
+ // Just fail as this is no longer supported.
+ return RespondNow(Error(kEphemeralAppLaunchingNotSupported));
}
WebstorePrivateGetEphemeralAppsEnabledFunction::
@@ -811,7 +720,7 @@ WebstorePrivateGetEphemeralAppsEnabledFunction::
ExtensionFunction::ResponseAction
WebstorePrivateGetEphemeralAppsEnabledFunction::Run() {
return RespondNow(ArgumentList(GetEphemeralAppsEnabled::Results::Create(
- EphemeralAppLauncher::IsFeatureEnabled())));
+ false)));
}
} // namespace extensions
diff --git a/chrome/browser/extensions/api/webstore_private/webstore_private_apitest.cc b/chrome/browser/extensions/api/webstore_private/webstore_private_apitest.cc
index 6d63a6a..656b7d3 100644
--- a/chrome/browser/extensions/api/webstore_private/webstore_private_apitest.cc
+++ b/chrome/browser/extensions/api/webstore_private/webstore_private_apitest.cc
@@ -32,7 +32,6 @@
#include "gpu/config/gpu_feature_type.h"
#include "gpu/config/gpu_info.h"
#include "net/dns/mock_host_resolver.h"
-#include "ui/app_list/app_list_switches.h"
#include "ui/gl/gl_switches.h"
using gpu::GpuFeatureType;
@@ -398,45 +397,6 @@ IN_PROC_BROWSER_TEST_F(ExtensionWebstoreGetWebGLStatusTest, Blocked) {
RunTest(webgl_allowed);
}
-class EphemeralAppWebstorePrivateApiTest
- : public ExtensionWebstorePrivateApiTest {
- public:
- void SetUpInProcessBrowserTestFixture() override {
- ExtensionWebstorePrivateApiTest::SetUpInProcessBrowserTestFixture();
-
- net::HostPortPair host_port = test_server()->host_port_pair();
- std::string test_gallery_url = base::StringPrintf(
- "http://www.example.com:%d/files/extensions/platform_apps/"
- "ephemeral_launcher",
- host_port.port());
- base::CommandLine::ForCurrentProcess()->AppendSwitchASCII(
- switches::kAppsGalleryURL, test_gallery_url);
- }
-
- GURL GetTestServerURL(const std::string& path) override {
- return DoGetTestServerURL(
- std::string("files/extensions/platform_apps/ephemeral_launcher/") +
- path);
- }
-};
-
-// Run tests when the --enable-ephemeral-apps switch is not enabled.
-IN_PROC_BROWSER_TEST_F(EphemeralAppWebstorePrivateApiTest,
- EphemeralAppsFeatureDisabled) {
- base::CommandLine::ForCurrentProcess()->AppendSwitch(
- app_list::switches::kDisableExperimentalAppList);
- ASSERT_TRUE(RunInstallTest("webstore_launch_disabled.html", "app.crx"));
-}
-
-// Run tests when the --enable-ephemeral-apps switch is enabled.
-IN_PROC_BROWSER_TEST_F(EphemeralAppWebstorePrivateApiTest, LaunchEphemeralApp) {
- base::CommandLine::ForCurrentProcess()->AppendSwitch(
- switches::kEnableEphemeralAppsInWebstore);
- base::CommandLine::ForCurrentProcess()->AppendSwitch(
- app_list::switches::kEnableExperimentalAppList);
- ASSERT_TRUE(RunInstallTest("webstore_launch_app.html", "app.crx"));
-}
-
class BundleWebstorePrivateApiTest
: public ExtensionWebstorePrivateApiTest {
public:
diff --git a/chrome/browser/extensions/crx_installer.cc b/chrome/browser/extensions/crx_installer.cc
index bcfd265..898c814 100644
--- a/chrome/browser/extensions/crx_installer.cc
+++ b/chrome/browser/extensions/crx_installer.cc
@@ -157,7 +157,6 @@ CrxInstaller::CrxInstaller(base::WeakPtr<ExtensionService> service_weak,
minimum_version_ = base::Version(*approval->minimum_version);
show_dialog_callback_ = approval->show_dialog_callback;
- set_is_ephemeral(approval->is_ephemeral);
}
CrxInstaller::~CrxInstaller() {
diff --git a/chrome/browser/extensions/install_observer.cc b/chrome/browser/extensions/install_observer.cc
index 37c7565..1145951 100644
--- a/chrome/browser/extensions/install_observer.cc
+++ b/chrome/browser/extensions/install_observer.cc
@@ -16,7 +16,6 @@ InstallObserver::ExtensionInstallParams::ExtensionInstallParams(
extension_name(extension_name),
installing_icon(installing_icon),
is_app(is_app),
- is_platform_app(is_platform_app),
- is_ephemeral(false) {}
+ is_platform_app(is_platform_app) {}
} // namespace extensions
diff --git a/chrome/browser/extensions/install_observer.h b/chrome/browser/extensions/install_observer.h
index faecf14..0185dd3 100644
--- a/chrome/browser/extensions/install_observer.h
+++ b/chrome/browser/extensions/install_observer.h
@@ -28,7 +28,6 @@ class InstallObserver {
gfx::ImageSkia installing_icon;
bool is_app;
bool is_platform_app;
- bool is_ephemeral;
};
// Called at the beginning of the complete installation process, i.e., this
diff --git a/chrome/browser/extensions/install_tracker.cc b/chrome/browser/extensions/install_tracker.cc
index 29758b2..67e0cbb 100644
--- a/chrome/browser/extensions/install_tracker.cc
+++ b/chrome/browser/extensions/install_tracker.cc
@@ -79,7 +79,6 @@ void InstallTracker::OnBeginExtensionInstall(
active_installs_.find(params.extension_id);
if (install_data == active_installs_.end()) {
ActiveInstallData install_data(params.extension_id);
- install_data.is_ephemeral = params.is_ephemeral;
active_installs_.insert(std::make_pair(params.extension_id, install_data));
}
diff --git a/chrome/browser/extensions/install_tracker_unittest.cc b/chrome/browser/extensions/install_tracker_unittest.cc
index e02400f..84572cd 100644
--- a/chrome/browser/extensions/install_tracker_unittest.cc
+++ b/chrome/browser/extensions/install_tracker_unittest.cc
@@ -61,7 +61,6 @@ class InstallTrackerTest : public testing::Test {
void VerifyInstallData(const ActiveInstallData& original,
const ActiveInstallData& retrieved) {
EXPECT_EQ(original.extension_id, retrieved.extension_id);
- EXPECT_EQ(original.is_ephemeral, retrieved.is_ephemeral);
EXPECT_EQ(original.percent_downloaded, retrieved.percent_downloaded);
}
@@ -75,7 +74,6 @@ TEST_F(InstallTrackerTest, AddAndRemoveActiveInstalls) {
ActiveInstallData install_data1(kExtensionId1);
install_data1.percent_downloaded = 76;
ActiveInstallData install_data2(kExtensionId2);
- install_data2.is_ephemeral = true;
tracker_->AddActiveInstall(install_data1);
tracker_->AddActiveInstall(install_data2);
@@ -174,7 +172,6 @@ TEST_F(InstallTrackerTest, DownloadProgressUpdated) {
TEST_F(InstallTrackerTest, ExtensionInstallFailure) {
InstallObserver::ExtensionInstallParams install_params(
kExtensionId1, std::string(), gfx::ImageSkia(), false, false);
- install_params.is_ephemeral = true;
tracker_->OnBeginExtensionInstall(install_params);
const ActiveInstallData* retrieved_data =
@@ -182,7 +179,6 @@ TEST_F(InstallTrackerTest, ExtensionInstallFailure) {
ASSERT_TRUE(retrieved_data);
EXPECT_EQ(0, retrieved_data->percent_downloaded);
EXPECT_EQ(install_params.extension_id, retrieved_data->extension_id);
- EXPECT_EQ(install_params.is_ephemeral, retrieved_data->is_ephemeral);
retrieved_data = NULL;
tracker_->OnInstallFailure(kExtensionId1);
@@ -200,7 +196,6 @@ TEST_F(InstallTrackerTest, ExtensionInstalledEvent) {
ASSERT_TRUE(retrieved_data);
EXPECT_EQ(0, retrieved_data->percent_downloaded);
EXPECT_EQ(install_params.extension_id, retrieved_data->extension_id);
- EXPECT_EQ(install_params.is_ephemeral, retrieved_data->is_ephemeral);
retrieved_data = NULL;
// Simulate an extension install.
diff --git a/chrome/browser/extensions/webstore_installer.cc b/chrome/browser/extensions/webstore_installer.cc
index d85cfad..f824dd6 100644
--- a/chrome/browser/extensions/webstore_installer.cc
+++ b/chrome/browser/extensions/webstore_installer.cc
@@ -241,8 +241,7 @@ WebstoreInstaller::Approval::Approval()
skip_post_install_ui(false),
skip_install_dialog(false),
enable_launcher(false),
- manifest_check_level(MANIFEST_CHECK_LEVEL_STRICT),
- is_ephemeral(false) {
+ manifest_check_level(MANIFEST_CHECK_LEVEL_STRICT) {
}
scoped_ptr<WebstoreInstaller::Approval>
@@ -358,7 +357,6 @@ void WebstoreInstaller::Start() {
approval_->installing_icon,
approval_->manifest->is_app(),
approval_->manifest->is_platform_app());
- params.is_ephemeral = approval_->is_ephemeral;
tracker->OnBeginExtensionInstall(params);
tracker->OnBeginExtensionDownload(id_);
diff --git a/chrome/browser/extensions/webstore_installer.h b/chrome/browser/extensions/webstore_installer.h
index 21f71a7..e02cbc6 100644
--- a/chrome/browser/extensions/webstore_installer.h
+++ b/chrome/browser/extensions/webstore_installer.h
@@ -161,9 +161,6 @@ class WebstoreInstaller : public content::NotificationObserver,
// Required minimum version.
scoped_ptr<Version> minimum_version;
- // Ephemeral apps are transiently installed.
- bool is_ephemeral;
-
// The authuser index required to download the item being installed. May be
// the empty string, in which case no authuser parameter is used.
std::string authuser;
diff --git a/chrome/browser/extensions/webstore_standalone_installer.cc b/chrome/browser/extensions/webstore_standalone_installer.cc
index 5b3ad15..760cb00 100644
--- a/chrome/browser/extensions/webstore_standalone_installer.cc
+++ b/chrome/browser/extensions/webstore_standalone_installer.cc
@@ -35,7 +35,6 @@ const char kInvalidManifestError[] = "Invalid manifest";
const char kUserCancelledError[] = "User cancelled install";
const char kExtensionIsBlacklisted[] = "Extension is blacklisted";
const char kInstallInProgressError[] = "An install is already in progress";
-const char kLaunchInProgressError[] = "A launch is already in progress";
WebstoreStandaloneInstaller::WebstoreStandaloneInstaller(
const std::string& webstore_item_id,
@@ -111,13 +110,8 @@ bool WebstoreStandaloneInstaller::EnsureUniqueInstall(
const ActiveInstallData* existing_install_data =
tracker->GetActiveInstall(id_);
if (existing_install_data) {
- if (existing_install_data->is_ephemeral) {
- *reason = webstore_install::LAUNCH_IN_PROGRESS;
- *error = kLaunchInProgressError;
- } else {
- *reason = webstore_install::INSTALL_IN_PROGRESS;
- *error = kInstallInProgressError;
- }
+ *reason = webstore_install::INSTALL_IN_PROGRESS;
+ *error = kInstallInProgressError;
return false;
}
@@ -215,8 +209,7 @@ void WebstoreStandaloneInstaller::InstallUIProceed() {
// Don't install a blacklisted extension.
install_result = webstore_install::BLACKLISTED;
install_message = kExtensionIsBlacklisted;
- } else if (util::IsEphemeralApp(installed_extension->id(), profile_) &&
- !approval->is_ephemeral) {
+ } else if (util::IsEphemeralApp(installed_extension->id(), profile_)) {
// 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.
diff --git a/chrome/browser/ui/app_list/extension_app_model_builder.cc b/chrome/browser/ui/app_list/extension_app_model_builder.cc
index 32bc979..ec4c287 100644
--- a/chrome/browser/ui/app_list/extension_app_model_builder.cc
+++ b/chrome/browser/ui/app_list/extension_app_model_builder.cc
@@ -128,7 +128,7 @@ void ExtensionAppModelBuilder::OnExtensionPreferenceChanged() {
void ExtensionAppModelBuilder::OnBeginExtensionInstall(
const ExtensionInstallParams& params) {
- if (!params.is_app || params.is_ephemeral)
+ if (!params.is_app)
return;
DVLOG(2) << service_ << ": OnBeginExtensionInstall: "
diff --git a/chrome/browser/ui/app_list/search/webstore/webstore_result.cc b/chrome/browser/ui/app_list/search/webstore/webstore_result.cc
index 80f9b35..d160709 100644
--- a/chrome/browser/ui/app_list/search/webstore/webstore_result.cc
+++ b/chrome/browser/ui/app_list/search/webstore/webstore_result.cc
@@ -9,7 +9,6 @@
#include "base/bind.h"
#include "base/memory/ref_counted.h"
#include "base/strings/utf_string_conversions.h"
-#include "chrome/browser/apps/ephemeral_app_launcher.h"
#include "chrome/browser/extensions/extension_service.h"
#include "chrome/browser/extensions/install_tracker.h"
#include "chrome/browser/extensions/install_tracker_factory.h"
diff --git a/chrome/chrome_browser_extensions.gypi b/chrome/chrome_browser_extensions.gypi
index 14ca531..7153cbe 100644
--- a/chrome/chrome_browser_extensions.gypi
+++ b/chrome/chrome_browser_extensions.gypi
@@ -74,8 +74,6 @@
'browser/apps/app_url_redirector.h',
'browser/apps/app_window_registry_util.cc',
'browser/apps/app_window_registry_util.h',
- 'browser/apps/ephemeral_app_launcher.cc',
- 'browser/apps/ephemeral_app_launcher.h',
'browser/apps/ephemeral_app_service.cc',
'browser/apps/ephemeral_app_service.h',
'browser/apps/ephemeral_app_service_factory.cc',
diff --git a/chrome/chrome_tests.gypi b/chrome/chrome_tests.gypi
index 4668ad1..e479331 100644
--- a/chrome/chrome_tests.gypi
+++ b/chrome/chrome_tests.gypi
@@ -56,7 +56,6 @@
'browser/apps/app_window_browsertest.cc',
'browser/apps/ephemeral_app_browsertest.cc',
'browser/apps/ephemeral_app_browsertest.h',
- 'browser/apps/ephemeral_app_launcher_browsertest.cc',
'browser/apps/ephemeral_app_service_browsertest.cc',
'browser/apps/event_page_browsertest.cc',
'browser/apps/guest_view/app_view_browsertest.cc',
diff --git a/chrome/common/chrome_switches.cc b/chrome/common/chrome_switches.cc
index 5d310e3..bbc05e8 100644
--- a/chrome/common/chrome_switches.cc
+++ b/chrome/common/chrome_switches.cc
@@ -414,10 +414,6 @@ const char kEnableDomainReliability[] = "enable-domain-reliability";
// Download Notification. (value is "", "enabled" or "disabled")
const char kEnableDownloadNotification[] = "enable-download-notification";
-// Enables experimentation with ephemeral apps to be launched from the webstore.
-const char kEnableEphemeralAppsInWebstore[] =
- "enable-ephemeral-apps-in-webstore";
-
// Enables experimental hotword features specific to always-on.
const char kEnableExperimentalHotwordHardware[] = "enable-hotword-hardware";
diff --git a/chrome/common/chrome_switches.h b/chrome/common/chrome_switches.h
index 69b5c48..5e53039 100644
--- a/chrome/common/chrome_switches.h
+++ b/chrome/common/chrome_switches.h
@@ -124,7 +124,6 @@ extern const char kEnableDevToolsExperiments[];
extern const char kEnableDeviceDiscoveryNotifications[];
extern const char kEnableDownloadNotification[];
extern const char kEnableDomainReliability[];
-extern const char kEnableEphemeralAppsInWebstore[];
extern const char kEnableExperimentalHotwordHardware[];
extern const char kEnableExtensionActivityLogging[];
extern const char kEnableExtensionActivityLogTesting[];
diff --git a/chrome/test/data/extensions/platform_apps/ephemeral_launcher/app.crx b/chrome/test/data/extensions/platform_apps/ephemeral_launcher/app.crx
deleted file mode 100644
index 0a8502b..0000000
--- a/chrome/test/data/extensions/platform_apps/ephemeral_launcher/app.crx
+++ /dev/null
Binary files differ
diff --git a/chrome/test/data/extensions/platform_apps/ephemeral_launcher/app.pem b/chrome/test/data/extensions/platform_apps/ephemeral_launcher/app.pem
deleted file mode 100644
index 6d2b6ae..0000000
--- a/chrome/test/data/extensions/platform_apps/ephemeral_launcher/app.pem
+++ /dev/null
@@ -1,28 +0,0 @@
------BEGIN PRIVATE KEY-----
-MIIEvwIBADANBgkqhkiG9w0BAQEFAASCBKkwggSlAgEAAoIBAQDBUe9m01dbRMdT
-irq/xyQojlugvSchBty8H/qWVs471yggJjkuN1A70Fmnk/oQCHkPhF5O6hV3ud0g
-u89dDG0NPDSWl2qX0No4jqyeQ2VFOV31ZHPVrtGO21xNjIebAQZ/svNrce9Q8bVy
-A3wUQXGvV+sOt7BhFU8AfYIqeQ5VldFeLM1zaLC8CsO8Eq12wsB/+h15EEKQtcDN
-c+y/BnKd1tq89Vl+CcUe5d5mZS11E9SsxdNxzY3JTh/0OSNF71edKYFchnNbe0/3
-Z85CfwktoQcIY7LovESm5o8Xf+3T1XBbc6Ifa4bfNjULGZuLXaNmksIz6nOw2GYt
-jKJHNoDVAgMBAAECggEBAIpD6N75PxyG9603ptOtQZ5EGyK+xrKnbs6abKaEFWLV
-QtyjmfgFFbyCCu2BN7Op67P+b1kvsQT9iTt1OB2L2p9BtTcTuug0Ny+GU82p1E+L
-dTkijHqDW1w6Zi0M2pwxQo2o1tK9HXYeOjD+bwspt366eeL/3AXDsMpf+e4YwPjS
-PT9ZFUr58pJH3e9p9oWa1i7LQssEqtgvHQjsLch05kj2V/pyJnydgwffcRQNguYE
-uVfxSUnrmE2w438pJbOXWOMiGNnWeI01gTs7hhjOETX6uGmQyoPCo/wMm9fd3vCc
-mjtJojsExxXHL1Mgbz4455SHPc33JCtI1My+RG4mSQ0CgYEA36XkTgYDVLnFBwfh
-2MytmI0PlU5uZP78t0E6rnshbaseQPos5e+/tfn1/Vb64Qmk528+6fbTzM4e3vLo
-d4KsvGf9SPs19ypm8OmAAu/3M6KjKOgG5YqoDsd6ED5qUjsTVB9LLjr9Xb5dPhte
-0ErFG8dqS7IkIRwr/lLBRkM7ec8CgYEA3UjxICZk7i+7apOmutr6Y9vcRiVFoDhj
-YHwZkr3CoRbwU0fPR1nm5qDXTAGDJ4S3iq7HsiSFByvzKizu4eIAyUz6028yKQ64
-di98B79S+Lh7PykWx27nujVMWWw4du46kkr1qEVHvOu0exPMlfGgUEb8zSSDZrnk
-31LDRRi22BsCgYEAkdMtJeKt0VS/r3HoROBQYKO5gXT+bkQEq8iQZqxKg6OLunpl
-RBgrPJCbYHCSbKFJMM5Mi2kxeNz9LAneoe5GiyKS+D80VNEFBhh6K3AkEzr8f/Oq
-a4kZQ2m1oVnRIYT7eWJeNuqnwbQaQCDAlbfrBc3k9S5WeHBSDyYOd63m3ekCgYEA
-mAUHWf3mctep2nLrJQ1Q3Q9rCWmLpqF2bA91hiEFN6PJoH0BwlPZ0/EFV3rmflyn
-tweRuylpll60I/JQfi/EOIbA/kYy4I/zW4YNoEjpGGOsj9yLgKEJYxxAgmJdfB73
-cA89KsfFm90V1UPp1cz0RJIwFEKUXxswR9fUvIBZBKcCgYAngAbZkkaq1VWo0qYy
-6tk7DyYob5kLvMY/FCDPx5+FZKz5NaJkIWkEvtytphidk2r4vqaCa9tp0VaTIe2Q
-2BShVaBnkKyF0Qn0f1XXiTfVIa/zduQc580vqI1FTCoXaPO/3wYa345AjrQoRZls
-nviXEgVqFDhTgBG0yzpSnHhhsg==
------END PRIVATE KEY-----
diff --git a/chrome/test/data/extensions/platform_apps/ephemeral_launcher/app/index.html b/chrome/test/data/extensions/platform_apps/ephemeral_launcher/app/index.html
deleted file mode 100644
index c341a40..0000000
--- a/chrome/test/data/extensions/platform_apps/ephemeral_launcher/app/index.html
+++ /dev/null
@@ -1 +0,0 @@
-<!-- empty -->
diff --git a/chrome/test/data/extensions/platform_apps/ephemeral_launcher/app/main.js b/chrome/test/data/extensions/platform_apps/ephemeral_launcher/app/main.js
deleted file mode 100644
index 0c87128..0000000
--- a/chrome/test/data/extensions/platform_apps/ephemeral_launcher/app/main.js
+++ /dev/null
@@ -1,10 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-chrome.app.runtime.onLaunched.addListener(function() {
- chrome.app.window.create('index.html', {}, function(win) {
- chrome.test.sendMessage('launched');
- win.close();
- });
-});
diff --git a/chrome/test/data/extensions/platform_apps/ephemeral_launcher/app/manifest.json b/chrome/test/data/extensions/platform_apps/ephemeral_launcher/app/manifest.json
deleted file mode 100644
index d57532b..0000000
--- a/chrome/test/data/extensions/platform_apps/ephemeral_launcher/app/manifest.json
+++ /dev/null
@@ -1,10 +0,0 @@
-{
- "name": "Simple Test App",
- "manifest_version": 2,
- "version": "1",
- "app": {
- "background": {
- "scripts": ["main.js"]
- }
- }
-}
diff --git a/chrome/test/data/extensions/platform_apps/ephemeral_launcher/app_with_permissions.crx b/chrome/test/data/extensions/platform_apps/ephemeral_launcher/app_with_permissions.crx
deleted file mode 100644
index a87cd95..0000000
--- a/chrome/test/data/extensions/platform_apps/ephemeral_launcher/app_with_permissions.crx
+++ /dev/null
Binary files differ
diff --git a/chrome/test/data/extensions/platform_apps/ephemeral_launcher/app_with_permissions.pem b/chrome/test/data/extensions/platform_apps/ephemeral_launcher/app_with_permissions.pem
deleted file mode 100644
index a552b2e..0000000
--- a/chrome/test/data/extensions/platform_apps/ephemeral_launcher/app_with_permissions.pem
+++ /dev/null
@@ -1,28 +0,0 @@
------BEGIN PRIVATE KEY-----
-MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQC5ZOMEtT5hrz5k
-Mh9cbalNWt8P81unURX+Q5sPx1PxOlCylF6EiciE+pQjcXSqFm2OsKQuNojqyEM6
-93LMQnT1UKRxrV7tSNALqGiQ6Xh4JKKe0sLqW4rFscw9Hjrzop8KeOpwUygiFgdD
-6t0NAVErSr85PNatureoC+nYEZxA7ESHI0X7SVnWoew7AFULfdWPYwQzmBbldFxx
-UNeGklYlxviahey9HHiHC/kWomwQ0NvdN9jGAhI5W9nuFs5XY+fSiO/HPYSX37vP
-0fkTyRPTkrRcncH9/YTh2vaEHDbHKsGZKuY8/nz2B32SX5zP+jjSQPJ8dfqjEFX6
-He6d4C7tAgMBAAECggEAMm4J/sbacDH+M70aoMbHrd4RHUKiZNH+vIphTJp47/5f
-4yPOzhi4rcuHrlh3VqkBJjZQgq2c8tiEyS50ULGnJO/Ju45gawVKalFmGD0Z4vx8
-K93C3YMHLZ2eo+VsPce3oV6gzusf2J3LXiMt/BKmpLMRbx1ofBt1R8Xt1zN7IIFt
-mR9gPF7EIzYRlD5M6Lj76j2e0dv/QZVdDOsNEcww1bys9If00BgLCPZmlAUz7rE5
-uQytekLwrb5EM3jb3MTANHivNwWWMY1BR2hQTgRQ+QDKmK020GIRzth3B0Xa3fkJ
-WpG26JbznF079IAFpb/+6b365mkTPs8TX3dyAa7iwQKBgQDpZYCh15bznP2jodfi
-LpT40xuyxvhiKLvH1WlRxgcm3QewoZvKHfZXQ6HUCOcfirunlNdQviiByIr8za7A
-qIXAsqg9W5BLCeLCMSAlRV4CnAF4457PShoFTaSN8Hu7MbpHSvM+NaDXm/lv5gNF
-XSrH0wBP/PmtInn4mb6BzZFTcQKBgQDLWUgYPuF6sFcsD1ve2gKoj71jGEnuPdqP
-5RF/ZIitS9sk+TP8KgsSycNFX1u/HrcuiOClVz3bZC39oKgqyEMiaUKYYBc+Tk71
-ymJkAdGoLoJnaINXqTTRUZO8zaErhyNQxFut6X+ejgqLgGPV5Mc/HQXVr8eG0NA7
-4W5Lo8OdPQKBgHu3PRcMw0xA1EXPfTK8hGTc6lq6k2DcvKTxn9Ejyhi0ouXi1ESv
-2ytogzh0u6aBkHUFNZjsI2agGeRlVpNzAOsjCID1ryfHhrZu+d4nxexWK4WcCktQ
-uThEbsx6Q+v3MQmnVgaMwMRpPjAtWWCEQTAIzaqYqvQ2STcYr934TGdRAoGAS997
-Q/iqXwHO9NSiPctwdH51drUIWMlhdJFO7w6O5MJJ+Ui2ed8iFJeNsaO78tq+FLHj
-yC1+Gg8ODfVU6emhCwTlYT9xTMEhOxqRjakUFkGMTJM1do7e8z8R9b9v5HLe3XL2
-ljRqdrme+6AjIBrlsQneNHYK56WgHMenRLfM9C0CgYEA4SW4+QaO7AYJIJhWCZ8I
-blFj6q95FUfsMEUBlEqJQJxKUSdn58AJ96RcwLD1KmXhyTNctD5BidkApFmi8IXa
-qJcbbCOinEJn2NFT6/C8ZbF8w6cvJaG8c3iLZaUwDmmX+oKC2GbqSYhqN2K96HUp
-tpcPgbZnwkbs/8pYq2jxTLk=
------END PRIVATE KEY-----
diff --git a/chrome/test/data/extensions/platform_apps/ephemeral_launcher/app_with_permissions/index.html b/chrome/test/data/extensions/platform_apps/ephemeral_launcher/app_with_permissions/index.html
deleted file mode 100644
index c341a40..0000000
--- a/chrome/test/data/extensions/platform_apps/ephemeral_launcher/app_with_permissions/index.html
+++ /dev/null
@@ -1 +0,0 @@
-<!-- empty -->
diff --git a/chrome/test/data/extensions/platform_apps/ephemeral_launcher/app_with_permissions/main.js b/chrome/test/data/extensions/platform_apps/ephemeral_launcher/app_with_permissions/main.js
deleted file mode 100644
index 0c87128..0000000
--- a/chrome/test/data/extensions/platform_apps/ephemeral_launcher/app_with_permissions/main.js
+++ /dev/null
@@ -1,10 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-chrome.app.runtime.onLaunched.addListener(function() {
- chrome.app.window.create('index.html', {}, function(win) {
- chrome.test.sendMessage('launched');
- win.close();
- });
-});
diff --git a/chrome/test/data/extensions/platform_apps/ephemeral_launcher/app_with_permissions/manifest.json b/chrome/test/data/extensions/platform_apps/ephemeral_launcher/app_with_permissions/manifest.json
deleted file mode 100644
index 534ff17..0000000
--- a/chrome/test/data/extensions/platform_apps/ephemeral_launcher/app_with_permissions/manifest.json
+++ /dev/null
@@ -1,11 +0,0 @@
-{
- "name": "Test App With Permissions",
- "manifest_version": 2,
- "version": "1",
- "app": {
- "background": {
- "scripts": ["main.js"]
- }
- },
- "permissions": ["audioCapture"]
-}
diff --git a/chrome/test/data/extensions/platform_apps/ephemeral_launcher/extension/manifest.json b/chrome/test/data/extensions/platform_apps/ephemeral_launcher/extension/manifest.json
deleted file mode 100644
index 0f9cc06..0000000
--- a/chrome/test/data/extensions/platform_apps/ephemeral_launcher/extension/manifest.json
+++ /dev/null
@@ -1,5 +0,0 @@
-{
- "name": "Test Extension",
- "version": "0.1",
- "manifest_version": 2
-}
diff --git a/chrome/test/data/extensions/platform_apps/ephemeral_launcher/inlineinstall/detail/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeid b/chrome/test/data/extensions/platform_apps/ephemeral_launcher/inlineinstall/detail/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeid
deleted file mode 100644
index b5895ac..0000000
--- a/chrome/test/data/extensions/platform_apps/ephemeral_launcher/inlineinstall/detail/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeid
+++ /dev/null
@@ -1,6 +0,0 @@
-{
- "users": "371,674",
- "average_rating": 4.36,
- "rating_count": 788,
- "manifest": "{\"name\":\"Test Extension\",\"version\":\"0.1\"}"
-}
diff --git a/chrome/test/data/extensions/platform_apps/ephemeral_launcher/inlineinstall/detail/haaaaaaaaaaaaaaaaaaaaaaaaaaappid b/chrome/test/data/extensions/platform_apps/ephemeral_launcher/inlineinstall/detail/haaaaaaaaaaaaaaaaaaaaaaaaaaappid
deleted file mode 100644
index 9d13885..0000000
--- a/chrome/test/data/extensions/platform_apps/ephemeral_launcher/inlineinstall/detail/haaaaaaaaaaaaaaaaaaaaaaaaaaappid
+++ /dev/null
@@ -1,6 +0,0 @@
-{
- "users": "371,674",
- "average_rating": 4.36,
- "rating_count": 788,
- "manifest": "{\"name\":\"Hosted App\",\"manifest_version\":2,\"version\":\"1\",\"app\": {\"launch\":{\"web_url\":\"http://foo.bar.com\"}}}"
-}
diff --git a/chrome/test/data/extensions/platform_apps/ephemeral_launcher/inlineinstall/detail/kbiancnbopdghkfedjhfdoegjadfjeal b/chrome/test/data/extensions/platform_apps/ephemeral_launcher/inlineinstall/detail/kbiancnbopdghkfedjhfdoegjadfjeal
deleted file mode 100644
index b3ef1c7..0000000
--- a/chrome/test/data/extensions/platform_apps/ephemeral_launcher/inlineinstall/detail/kbiancnbopdghkfedjhfdoegjadfjeal
+++ /dev/null
@@ -1,6 +0,0 @@
-{
- "users": "371,674",
- "average_rating": 4.36,
- "rating_count": 788,
- "manifest": "{\"name\":\"Simple Test App\",\"manifest_version\":2,\"version\":\"1\",\"app\": {\"background\":{\"scripts\":[\"main.js\"]}}}"
-}
diff --git a/chrome/test/data/extensions/platform_apps/ephemeral_launcher/inlineinstall/detail/lnbochkobjfnhbnbljgfgokadhmbahcn b/chrome/test/data/extensions/platform_apps/ephemeral_launcher/inlineinstall/detail/lnbochkobjfnhbnbljgfgokadhmbahcn
deleted file mode 100644
index add5618..0000000
--- a/chrome/test/data/extensions/platform_apps/ephemeral_launcher/inlineinstall/detail/lnbochkobjfnhbnbljgfgokadhmbahcn
+++ /dev/null
@@ -1,6 +0,0 @@
-{
- "users": "371,674",
- "average_rating": 4.36,
- "rating_count": 788,
- "manifest": "{\"name\":\"Legacy Test App\",\"manifest_version\":2,\"version\":\"1\",\"app\": {\"launch\":{\"local_path\":\"main.html\"}}}"
-}
diff --git a/chrome/test/data/extensions/platform_apps/ephemeral_launcher/inlineinstall/detail/mbfcnecjknjpipkfkoangpfnhhlpamki b/chrome/test/data/extensions/platform_apps/ephemeral_launcher/inlineinstall/detail/mbfcnecjknjpipkfkoangpfnhhlpamki
deleted file mode 100644
index 90a4ce7..0000000
--- a/chrome/test/data/extensions/platform_apps/ephemeral_launcher/inlineinstall/detail/mbfcnecjknjpipkfkoangpfnhhlpamki
+++ /dev/null
@@ -1,6 +0,0 @@
-{
- "users": "371,674",
- "average_rating": 4.36,
- "rating_count": 788,
- "manifest": "{\"name\":\"Test App With Permissions\",\"manifest_version\":2,\"version\":\"1\",\"app\":{\"background\":{\"scripts\":[\"main.js\"]}},\"permissions\":[\"audioCapture\"]}"
-}
diff --git a/chrome/test/data/extensions/platform_apps/ephemeral_launcher/legacy_app.pem b/chrome/test/data/extensions/platform_apps/ephemeral_launcher/legacy_app.pem
deleted file mode 100644
index d8a09ee..0000000
--- a/chrome/test/data/extensions/platform_apps/ephemeral_launcher/legacy_app.pem
+++ /dev/null
@@ -1,28 +0,0 @@
------BEGIN PRIVATE KEY-----
-MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDFKMlqF/85M27R
-i/cy5yHx/KHnzqmLtB7UjtHWFejeB+aKM4c6HHc9yXkbomEcTbR1hgy6VC02xYxX
-+0dZX1/tuBQS/aIVrk7Bd8Jnv5/4pHDfX/w8likmR04yqZrdIutoQCa30vZ/GgMu
-/nWV7oP7ehfRzNK6apfH9mYmKvyMJ/i5rZZnQtIukApdMPuwq04U7z1A7OolmloA
-lnZLj3F3PWE5RStpJmFZ/kAHT3p/QXm3Putj6exfEw+4oho97h2F/uhbgR06+eBp
-vy5/bTfE22wV56VFuTa2MhY+76mDsnMNIRCIcn68qW7ZUOa+0FgRtYt91rGoLfRq
-bCYjfDU/AgMBAAECggEBAJLp4KRI+2rhU4ub83kf2CCcsvyr95TdhDe5sM0JiHui
-gXysBvEbcxM8hR09c4WGtZj5aZSS0xpEPF73JGSJeE8IYxT/oH7tY0ww9FEg7pB1
-4JHi0W9IKaOXcMK5tWdg9O+7Fd7Wuc1eUc772B0AHaMPiJ5SNRiqAy4DAn0gfQ3m
-D6r5TQ+cBeptCsNBj9HaHxhJVg7SCv4GohBqP8HkMEv4trg8/ugEv0NfOgd+LiVO
-ewX/f2El7gP6nvTDNbx0gRT0HoTzBGZkQlUuvcX2xPr1AvXhYaRMpmq18yHzXpae
-iqGL//jk4TMQW0qzvfsyQc3Pw5xnoU54hU1goVTBpaECgYEA7z8HXVZ3Ed0q9pmG
-R7+f+PVJPW1JWTFi4XtR5SxgNwfQFyUGWsB7DoMuUQrc+8ZY0ckUWIPYXF3yUuPg
-rf5iBtjtfAn1zung1qpPC98G+TNR9A8cK/4S4XV7FQ75QBaP3/SZRXHiuQB5RQU7
-UQWHbfY0YfIW/o1fHIifv1VGNc8CgYEA0vdEAt4ZRO/BQmA6Fz8dpMKWca9qSqQI
-64scdq4Bxc1QSUWkwMUVXYr+GVa/TgUvFnFSbCn10KP3aK6k8eX9PMYGXBaoB/Gy
-pmbTELCCycUP4g9WdLc0y4IlNgSnkopdU8PZzyQPl0+dfzOgnlz21piIKeARQiWC
-EsR9b3wGVZECgYBxAaiM4gakHX/ps2LGCTGa+uF5bmGzC6zVLNbmFSvtUndsN0Tl
-IP3/QN9j0GnJU0so7H37wWs1VfrcRF8gUIQlD9o9OMcu0TIus4ta5CH7G86eJXT9
-IqnwbPmSXNxG9WFIO9UaBE0/bYXaoDoAb0glHKJpkVxjKIvAgphSXAkp6QKBgQCW
-0XappiXihpRe43QkElca5pGvDHysh8Bow7bBkXxq8HCpMUSrGzo++ZLWgpGZMVOM
-c888zHKTieThzZjV5lm4DMmXJAtUQpI5K+FQWR/nJx5HujdQkXkI1C3OBF3YAVre
-+3DHCTysK5qoyTvWexdsKveNGEa+RxpKWHZkMQJGQQKBgBisFK4JxCu9s44wL5Ce
-OrlEX1XDnuHN3NGC1vPn1hJz+AEqxL0OH08T6Q8AbiXqFhWrzPG4M4wXHqAIUjid
-IbgLZYmL6PzgKPvs/vlTC1O3MncsJs8S8wVRu2REfnLHdRhrWQESPhzr7XUXHlNf
-mApQ0hAp8tztYwHjEgZBm6TG
------END PRIVATE KEY-----
diff --git a/chrome/test/data/extensions/platform_apps/ephemeral_launcher/legacy_app/main.html b/chrome/test/data/extensions/platform_apps/ephemeral_launcher/legacy_app/main.html
deleted file mode 100644
index 8060cb2..0000000
--- a/chrome/test/data/extensions/platform_apps/ephemeral_launcher/legacy_app/main.html
+++ /dev/null
@@ -1,11 +0,0 @@
-<!--
- * Copyright 2014 The Chromium Authors. All rights reserved. Use of this
- * source code is governed by a BSD-style license that can be found in the
- * LICENSE file.
--->
-
-<html>
-<body>
-<script src="main.js"></script>
-</body>
-</html>
diff --git a/chrome/test/data/extensions/platform_apps/ephemeral_launcher/legacy_app/main.js b/chrome/test/data/extensions/platform_apps/ephemeral_launcher/legacy_app/main.js
deleted file mode 100644
index e92d3e5..0000000
--- a/chrome/test/data/extensions/platform_apps/ephemeral_launcher/legacy_app/main.js
+++ /dev/null
@@ -1,5 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-chrome.test.sendMessage('launched');
diff --git a/chrome/test/data/extensions/platform_apps/ephemeral_launcher/legacy_app/manifest.json b/chrome/test/data/extensions/platform_apps/ephemeral_launcher/legacy_app/manifest.json
deleted file mode 100644
index 95fe281..0000000
--- a/chrome/test/data/extensions/platform_apps/ephemeral_launcher/legacy_app/manifest.json
+++ /dev/null
@@ -1,10 +0,0 @@
-{
- "name": "Legacy Test App",
- "manifest_version": 2,
- "version": "1",
- "app": {
- "launch": {
- "local_path": "main.html"
- }
- }
-}
diff --git a/chrome/test/data/extensions/platform_apps/ephemeral_launcher/webstore_common.js b/chrome/test/data/extensions/platform_apps/ephemeral_launcher/webstore_common.js
deleted file mode 100644
index f79d086..0000000
--- a/chrome/test/data/extensions/platform_apps/ephemeral_launcher/webstore_common.js
+++ /dev/null
@@ -1,39 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// Error codes and messages.
-var kFeatureDisabledCode = "feature_disabled";
-var kFeatureDisabledError =
- "[feature_disabled]: Launching ephemeral apps is not enabled";
-var kFeatureUserGestureCode = "user_gesture_required";
-var kFeatureUserGestureError =
- "[user_gesture_required]: User gesture is required";
-var kInstallInProgressCode = "install_in_progress";
-var kInstallInProgressError =
- "[install_in_progress]: An install is already in progress";
-var kUnsupportedExtensionTypeCode = "unsupported_extension_type";
-var kUnsupportedExtensionTypeError =
- "[unsupported_extension_type]: Not an app";
-
-// App ids.
-var kDefaultAppId = "kbiancnbopdghkfedjhfdoegjadfjeal";
-var kDefaultAppManifestPath = "app/manifest.json";
-var kAppWithPermissionsId = "mbfcnecjknjpipkfkoangpfnhhlpamki";
-var kAppWithPermissionsManifestPath = "app_with_permissions/manifest.json";
-var kExtensionId = "eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeid";
-
-var assertEq = chrome.test.assertEq;
-var assertFalse = chrome.test.assertFalse;
-var assertTrue = chrome.test.assertTrue;
-var callbackFail = chrome.test.callbackFail;
-var callbackPass = chrome.test.callbackPass;
-
-// Returns the string contents of the app's manifest file.
-function getManifest(path) {
- // Do a synchronous XHR to get the manifest.
- var xhr = new XMLHttpRequest();
- xhr.open("GET", path, false);
- xhr.send(null);
- return xhr.responseText;
-}
diff --git a/chrome/test/data/extensions/platform_apps/ephemeral_launcher/webstore_launch_app.html b/chrome/test/data/extensions/platform_apps/ephemeral_launcher/webstore_launch_app.html
deleted file mode 100644
index 4667add..0000000
--- a/chrome/test/data/extensions/platform_apps/ephemeral_launcher/webstore_launch_app.html
+++ /dev/null
@@ -1,8 +0,0 @@
-<!--
- * Copyright 2014 The Chromium Authors. All rights reserved. Use of this
- * source code is governed by a BSD-style license that can be found in the
- * LICENSE file.
--->
-
-<script src="webstore_common.js"></script>
-<script src="webstore_launch_app.js"></script>
diff --git a/chrome/test/data/extensions/platform_apps/ephemeral_launcher/webstore_launch_app.js b/chrome/test/data/extensions/platform_apps/ephemeral_launcher/webstore_launch_app.js
deleted file mode 100644
index 0c08950..0000000
--- a/chrome/test/data/extensions/platform_apps/ephemeral_launcher/webstore_launch_app.js
+++ /dev/null
@@ -1,69 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-var tests = [
-
- // Verifies that getEphemeralAppsEnabled() will return true.
- function canLaunchEphemeralApp() {
- chrome.webstorePrivate.getEphemeralAppsEnabled(
- callbackPass(function(isEnabled) {
- assertTrue(isEnabled);
- }));
- },
-
- // Verifies that launchEphemeralApp() will fail without a user gesture.
- function noUserGesture() {
- chrome.webstorePrivate.launchEphemeralApp(
- kDefaultAppId,
- callbackFail(kFeatureUserGestureError, function(result) {
- assertEq(kFeatureUserGestureCode, result);
- }));
- },
-
- // Test an attempt to launch an extension.
- function launchExtension() {
- chrome.test.runWithUserGesture(function() {
- chrome.webstorePrivate.launchEphemeralApp(
- kExtensionId,
- callbackFail(kUnsupportedExtensionTypeError, function(result) {
- assertEq(kUnsupportedExtensionTypeCode, result);
- }));
- });
- },
-
- // Test a successful ephemeral install and launch.
- function launchSuccess() {
- chrome.test.runWithUserGesture(function() {
- chrome.webstorePrivate.launchEphemeralApp(
- kDefaultAppId,
- callbackPass(function(result) {
- assertEq("success", result);
- }));
- });
- },
-
- // Verifies that launchEphemeralApp() will fail if a full install is in
- // progress.
- function pendingInstall() {
- // First initiate a full install of the app.
- var manifest = getManifest(kAppWithPermissionsManifestPath);
- chrome.webstorePrivate.beginInstallWithManifest3(
- { "id": kAppWithPermissionsId, "manifest": manifest },
- callbackPass(function(result) {
- assertEq(result, "");
-
- // Attempt to launch the app ephemerally.
- chrome.test.runWithUserGesture(function() {
- chrome.webstorePrivate.launchEphemeralApp(
- kAppWithPermissionsId,
- callbackFail(kInstallInProgressError, function(result) {
- assertEq(kInstallInProgressCode, result);
- }));
- });
- }));
- }
-
-];
-
-chrome.test.runTests(tests);
diff --git a/chrome/test/data/extensions/platform_apps/ephemeral_launcher/webstore_launch_disabled.html b/chrome/test/data/extensions/platform_apps/ephemeral_launcher/webstore_launch_disabled.html
deleted file mode 100644
index 086e370..0000000
--- a/chrome/test/data/extensions/platform_apps/ephemeral_launcher/webstore_launch_disabled.html
+++ /dev/null
@@ -1,8 +0,0 @@
-<!--
- * Copyright 2014 The Chromium Authors. All rights reserved. Use of this
- * source code is governed by a BSD-style license that can be found in the
- * LICENSE file.
--->
-
-<script src="webstore_common.js"></script>
-<script src="webstore_launch_disabled.js"></script>
diff --git a/chrome/test/data/extensions/platform_apps/ephemeral_launcher/webstore_launch_disabled.js b/chrome/test/data/extensions/platform_apps/ephemeral_launcher/webstore_launch_disabled.js
deleted file mode 100644
index 9c7f4ed..0000000
--- a/chrome/test/data/extensions/platform_apps/ephemeral_launcher/webstore_launch_disabled.js
+++ /dev/null
@@ -1,30 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-var tests = [
-
- // Verifies that getEphemeralAppsEnabled() will return false if the feature
- // is not enabled.
- function canLaunchEphemeralApp() {
- chrome.webstorePrivate.getEphemeralAppsEnabled(
- callbackPass(function(isEnabled) {
- assertFalse(isEnabled);
- }));
- },
-
- // Verifies that if the feature is not enabled, launchEphemeralApp() will not
- // succeed.
- function launchEphemeralApp() {
- chrome.test.runWithUserGesture(function() {
- chrome.webstorePrivate.launchEphemeralApp(
- kDefaultAppId,
- callbackFail(kFeatureDisabledError, function(result) {
- assertEq(kFeatureDisabledCode, result);
- }));
- });
- }
-
-];
-
-chrome.test.runTests(tests);