Commit 23bdeff7 authored by nancy's avatar nancy Committed by Commit Bot

Remove launch_util.*.

Launch_util is used to wrap the ChromeLauncherController's LaunchApp
function for AppService to launch apps. Now AppService
can launch apps directly, and no longer depends on
ChromeLauncherController, so launch_util can be removed.

BUG=1002351

Change-Id: I411186e398f79f0e0cc13b25946e2feea5512d38
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1810516Reviewed-by: default avatarNigel Tao <nigeltao@chromium.org>
Reviewed-by: default avatarDominick Ng <dominickn@chromium.org>
Commit-Queue: Nancy Wang <nancylingwang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#697914}
parent fc93d91e
...@@ -3632,8 +3632,6 @@ jumbo_split_static_library("browser") { ...@@ -3632,8 +3632,6 @@ jumbo_split_static_library("browser") {
"apps/app_service/extension_apps.h", "apps/app_service/extension_apps.h",
"apps/app_service/icon_key_util.cc", "apps/app_service/icon_key_util.cc",
"apps/app_service/icon_key_util.h", "apps/app_service/icon_key_util.h",
"apps/app_service/launch_util.cc",
"apps/app_service/launch_util.h",
"ash_service_registry.cc", "ash_service_registry.cc",
"ash_service_registry.h", "ash_service_registry.h",
"component_updater/cros_component_installer_chromeos.cc", "component_updater/cros_component_installer_chromeos.cc",
......
...@@ -7,7 +7,6 @@ ...@@ -7,7 +7,6 @@
#include <utility> #include <utility>
#include "chrome/browser/apps/app_service/dip_px_util.h" #include "chrome/browser/apps/app_service/dip_px_util.h"
#include "chrome/browser/apps/app_service/launch_util.h"
#include "chrome/browser/chromeos/crostini/crostini_pref_names.h" #include "chrome/browser/chromeos/crostini/crostini_pref_names.h"
#include "chrome/browser/chromeos/crostini/crostini_registry_service_factory.h" #include "chrome/browser/chromeos/crostini/crostini_registry_service_factory.h"
#include "chrome/browser/chromeos/crostini/crostini_util.h" #include "chrome/browser/chromeos/crostini/crostini_util.h"
......
...@@ -14,7 +14,6 @@ ...@@ -14,7 +14,6 @@
#include "base/callback.h" #include "base/callback.h"
#include "base/strings/string16.h" #include "base/strings/string16.h"
#include "chrome/browser/apps/app_service/app_icon_factory.h" #include "chrome/browser/apps/app_service/app_icon_factory.h"
#include "chrome/browser/apps/app_service/launch_util.h"
#include "chrome/browser/apps/launch_service/launch_service.h" #include "chrome/browser/apps/launch_service/launch_service.h"
#include "chrome/browser/chromeos/extensions/gfx_utils.h" #include "chrome/browser/chromeos/extensions/gfx_utils.h"
#include "chrome/browser/content_settings/host_content_settings_map_factory.h" #include "chrome/browser/content_settings/host_content_settings_map_factory.h"
......
// Copyright (c) 2019 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/app_service/launch_util.h"
#include "ash/public/cpp/shelf_types.h"
#include "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h"
namespace {
ash::ShelfLaunchSource ConvertLaunchSource(
apps::mojom::LaunchSource launch_source) {
switch (launch_source) {
case apps::mojom::LaunchSource::kUnknown:
case apps::mojom::LaunchSource::kFromParentalControls:
return ash::LAUNCH_FROM_UNKNOWN;
case apps::mojom::LaunchSource::kFromAppListGrid:
case apps::mojom::LaunchSource::kFromAppListGridContextMenu:
return ash::LAUNCH_FROM_APP_LIST;
case apps::mojom::LaunchSource::kFromAppListQuery:
case apps::mojom::LaunchSource::kFromAppListQueryContextMenu:
case apps::mojom::LaunchSource::kFromAppListRecommendation:
return ash::LAUNCH_FROM_APP_LIST_SEARCH;
case apps::mojom::LaunchSource::kFromShelf:
return ash::LAUNCH_FROM_SHELF;
}
}
} // namespace
namespace apps_util {
void Launch(const std::string& app_id,
int32_t event_flags,
apps::mojom::LaunchSource launch_source,
int64_t display_id) {
ChromeLauncherController::instance()->LaunchApp(
ash::ShelfID(app_id), ConvertLaunchSource(launch_source), event_flags,
display_id);
}
} // namespace apps_util
// Copyright (c) 2019 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_APP_SERVICE_LAUNCH_UTIL_H_
#define CHROME_BROWSER_APPS_APP_SERVICE_LAUNCH_UTIL_H_
// Utility functions for launching an app.
#include <string>
#include "chrome/services/app_service/public/mojom/types.mojom.h"
namespace apps_util {
void Launch(const std::string& app_id,
int32_t event_flags,
apps::mojom::LaunchSource launch_source,
int64_t display_id);
} // namespace apps_util
#endif // CHROME_BROWSER_APPS_APP_SERVICE_LAUNCH_UTIL_H_
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment