Commit b072c2cc authored by nancy's avatar nancy Committed by Commit Bot

Remove launcher_arc_app_updater.

LauncherAppServiceAppUpdater is used to replace
launcher_arc_app_updater, so launcher_arc_app_updater can be removed.

BUG=1016159

Change-Id: Ic70f1622fd3d9387474f4d30d0bea9d97049b4ec
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2049443Reviewed-by: default avatarXiyuan Xia <xiyuan@chromium.org>
Commit-Queue: Nancy Wang <nancylingwang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#740416}
parent 822d094b
...@@ -3881,8 +3881,6 @@ jumbo_static_library("ui") { ...@@ -3881,8 +3881,6 @@ jumbo_static_library("ui") {
"ash/launcher/internal_app_shelf_context_menu.h", "ash/launcher/internal_app_shelf_context_menu.h",
"ash/launcher/internal_app_window_shelf_controller.cc", "ash/launcher/internal_app_window_shelf_controller.cc",
"ash/launcher/internal_app_window_shelf_controller.h", "ash/launcher/internal_app_window_shelf_controller.h",
"ash/launcher/launcher_arc_app_updater.cc",
"ash/launcher/launcher_arc_app_updater.h",
"ash/launcher/shelf_spinner_controller.cc", "ash/launcher/shelf_spinner_controller.cc",
"ash/launcher/shelf_spinner_controller.h", "ash/launcher/shelf_spinner_controller.h",
"ash/launcher/shelf_spinner_item_controller.cc", "ash/launcher/shelf_spinner_item_controller.cc",
......
...@@ -53,7 +53,6 @@ ...@@ -53,7 +53,6 @@
#include "chrome/browser/ui/ash/launcher/chrome_launcher_controller_util.h" #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller_util.h"
#include "chrome/browser/ui/ash/launcher/crostini_app_window_shelf_controller.h" #include "chrome/browser/ui/ash/launcher/crostini_app_window_shelf_controller.h"
#include "chrome/browser/ui/ash/launcher/internal_app_window_shelf_controller.h" #include "chrome/browser/ui/ash/launcher/internal_app_window_shelf_controller.h"
#include "chrome/browser/ui/ash/launcher/launcher_arc_app_updater.h"
#include "chrome/browser/ui/ash/launcher/launcher_controller_helper.h" #include "chrome/browser/ui/ash/launcher/launcher_controller_helper.h"
#include "chrome/browser/ui/ash/launcher/launcher_extension_app_updater.h" #include "chrome/browser/ui/ash/launcher/launcher_extension_app_updater.h"
#include "chrome/browser/ui/ash/launcher/multi_profile_app_window_launcher_controller.h" #include "chrome/browser/ui/ash/launcher/multi_profile_app_window_launcher_controller.h"
...@@ -1344,31 +1343,18 @@ void ChromeLauncherController::AttachProfile(Profile* profile_to_attach) { ...@@ -1344,31 +1343,18 @@ void ChromeLauncherController::AttachProfile(Profile* profile_to_attach) {
base::Bind(&ChromeLauncherController::ScheduleUpdateAppLaunchersFromSync, base::Bind(&ChromeLauncherController::ScheduleUpdateAppLaunchersFromSync,
base::Unretained(this))); base::Unretained(this)));
if (app_service_enabled) { std::unique_ptr<LauncherAppUpdater> app_service_app_updater(
std::unique_ptr<LauncherAppUpdater> app_service_app_updater( new LauncherAppServiceAppUpdater(this, profile()));
new LauncherAppServiceAppUpdater(this, profile())); app_updaters_.push_back(std::move(app_service_app_updater));
app_updaters_.push_back(std::move(app_service_app_updater));
// Some special extensions open new windows, and on Chrome OS, those windows
// Some special extensions open new windows, and on Chrome OS, those windows // should show the extension icon in the shelf. Extensions are not present
// should show the extension icon in the shelf. Extensions are not present // in the App Service, so use LauncherExtensionAppUpdater to handle
// in the App Service, so use LauncherExtensionAppUpdater to handle // extensions life-cycle events.
// extensions life-cycle events. std::unique_ptr<LauncherExtensionAppUpdater> extension_app_updater(
std::unique_ptr<LauncherExtensionAppUpdater> extension_app_updater( new LauncherExtensionAppUpdater(this, profile(),
new LauncherExtensionAppUpdater(this, profile(), true /* extensions_only */));
true /* extensions_only */)); app_updaters_.push_back(std::move(extension_app_updater));
app_updaters_.push_back(std::move(extension_app_updater));
} else {
std::unique_ptr<LauncherAppUpdater> extension_app_updater(
new LauncherExtensionAppUpdater(this, profile(),
false /* extensions_only */));
app_updaters_.push_back(std::move(extension_app_updater));
if (arc::IsArcAllowedForProfile(profile())) {
std::unique_ptr<LauncherAppUpdater> arc_app_updater(
new LauncherArcAppUpdater(this, profile()));
app_updaters_.push_back(std::move(arc_app_updater));
}
}
app_list::AppListSyncableService* app_list_syncable_service = app_list::AppListSyncableService* app_list_syncable_service =
app_list::AppListSyncableServiceFactory::GetForProfile(profile()); app_list::AppListSyncableServiceFactory::GetForProfile(profile());
......
// Copyright 2016 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/ui/ash/launcher/launcher_arc_app_updater.h"
#include "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h"
LauncherArcAppUpdater::LauncherArcAppUpdater(
Delegate* delegate,
content::BrowserContext* browser_context)
: LauncherAppUpdater(delegate, browser_context) {
ArcAppListPrefs* prefs = ArcAppListPrefs::Get(browser_context);
DCHECK(prefs);
prefs->AddObserver(this);
}
LauncherArcAppUpdater::~LauncherArcAppUpdater() {
ArcAppListPrefs* prefs = ArcAppListPrefs::Get(browser_context());
DCHECK(prefs);
prefs->RemoveObserver(this);
}
void LauncherArcAppUpdater::OnAppRegistered(
const std::string& app_id,
const ArcAppListPrefs::AppInfo& app_info) {
delegate()->OnAppInstalled(browser_context(), app_id);
}
void LauncherArcAppUpdater::OnAppRemoved(const std::string& app_id) {
// ChromeLauncherController generally removes items from the sync model when
// they are removed from the shelf model, but that should not happen when ARC
// apps are disabled due to ARC itself being disabled. The app entries should
// remain in the sync model for other synced devices that do support ARC, and
// to restore the respective shelf items if ARC is re-enabled on this device.
ChromeLauncherController::ScopedPinSyncDisabler scoped_pin_sync_disabler =
ChromeLauncherController::instance()->GetScopedPinSyncDisabler();
delegate()->OnAppUninstalledPrepared(browser_context(), app_id);
delegate()->OnAppUninstalled(browser_context(), app_id);
}
// Copyright 2016 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_UI_ASH_LAUNCHER_LAUNCHER_ARC_APP_UPDATER_H_
#define CHROME_BROWSER_UI_ASH_LAUNCHER_LAUNCHER_ARC_APP_UPDATER_H_
#include <string>
#include "base/macros.h"
#include "chrome/browser/ui/app_list/arc/arc_app_list_prefs.h"
#include "chrome/browser/ui/ash/launcher/launcher_app_updater.h"
class LauncherArcAppUpdater : public LauncherAppUpdater,
public ArcAppListPrefs::Observer {
public:
LauncherArcAppUpdater(Delegate* delegate,
content::BrowserContext* browser_context);
~LauncherArcAppUpdater() override;
// ArcAppListPrefs::Observer:
void OnAppRegistered(const std::string& app_id,
const ArcAppListPrefs::AppInfo& app_info) override;
void OnAppRemoved(const std::string& id) override;
private:
DISALLOW_COPY_AND_ASSIGN(LauncherArcAppUpdater);
};
#endif // CHROME_BROWSER_UI_ASH_LAUNCHER_LAUNCHER_ARC_APP_UPDATER_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