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

Remove LauncherCrostiniAppUpdater.

kAppServiceShelf will be removed in M82 release, so this is the
pareparing for that. I will follow up to remove more stuff, then finally
remove that flag.

BUG=1016159

Change-Id: I3da4b9e304a182e742f58cf59fc548818fefb13c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2037172Reviewed-by: default avatarXiyuan Xia <xiyuan@chromium.org>
Commit-Queue: Nancy Wang <nancylingwang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#738342}
parent 5ace4571
......@@ -3878,8 +3878,6 @@ jumbo_static_library("ui") {
"ash/launcher/internal_app_window_shelf_controller.h",
"ash/launcher/launcher_arc_app_updater.cc",
"ash/launcher/launcher_arc_app_updater.h",
"ash/launcher/launcher_crostini_app_updater.cc",
"ash/launcher/launcher_crostini_app_updater.h",
"ash/launcher/shelf_spinner_controller.cc",
"ash/launcher/shelf_spinner_controller.h",
"ash/launcher/shelf_spinner_item_controller.cc",
......
......@@ -56,7 +56,6 @@
#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_crostini_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_browser_status_monitor.h"
......@@ -1377,12 +1376,6 @@ void ChromeLauncherController::AttachProfile(Profile* profile_to_attach) {
new LauncherArcAppUpdater(this, profile()));
app_updaters_.push_back(std::move(arc_app_updater));
}
if (crostini::CrostiniFeatures::Get()->IsUIAllowed(profile())) {
std::unique_ptr<LauncherAppUpdater> crostini_app_updater(
new LauncherCrostiniAppUpdater(this, profile()));
app_updaters_.push_back(std::move(crostini_app_updater));
}
}
app_list::AppListSyncableService* app_list_syncable_service =
......
// Copyright 2018 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_crostini_app_updater.h"
#include "chrome/browser/chromeos/crostini/crostini_registry_service_factory.h"
#include "chrome/browser/profiles/profile.h"
LauncherCrostiniAppUpdater::LauncherCrostiniAppUpdater(
Delegate* delegate,
content::BrowserContext* browser_context)
: LauncherAppUpdater(delegate, browser_context) {
crostini::CrostiniRegistryService* registry_service =
crostini::CrostiniRegistryServiceFactory::GetForProfile(
Profile::FromBrowserContext(browser_context));
registry_service->AddObserver(this);
}
LauncherCrostiniAppUpdater::~LauncherCrostiniAppUpdater() {
crostini::CrostiniRegistryService* registry_service =
crostini::CrostiniRegistryServiceFactory::GetForProfile(
Profile::FromBrowserContext(browser_context()));
registry_service->RemoveObserver(this);
}
void LauncherCrostiniAppUpdater::OnRegistryUpdated(
crostini::CrostiniRegistryService* registry_service,
const std::vector<std::string>& updated_apps,
const std::vector<std::string>& removed_apps,
const std::vector<std::string>& inserted_apps) {
for (const std::string& app_id : updated_apps)
delegate()->OnAppUpdated(browser_context(), app_id);
for (const std::string& app_id : removed_apps) {
delegate()->OnAppUninstalledPrepared(browser_context(), app_id);
delegate()->OnAppUninstalled(browser_context(), app_id);
}
for (const std::string& app_id : inserted_apps)
delegate()->OnAppInstalled(browser_context(), app_id);
}
// Copyright 2018 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_CROSTINI_APP_UPDATER_H_
#define CHROME_BROWSER_UI_ASH_LAUNCHER_LAUNCHER_CROSTINI_APP_UPDATER_H_
#include <string>
#include "base/macros.h"
#include "chrome/browser/chromeos/crostini/crostini_registry_service.h"
#include "chrome/browser/ui/ash/launcher/launcher_app_updater.h"
class LauncherCrostiniAppUpdater
: public LauncherAppUpdater,
public crostini::CrostiniRegistryService::Observer {
public:
LauncherCrostiniAppUpdater(Delegate* delegate,
content::BrowserContext* browser_context);
~LauncherCrostiniAppUpdater() override;
// crostini::CrostiniRegistryService::Observer:
void OnRegistryUpdated(
crostini::CrostiniRegistryService* registry_service,
const std::vector<std::string>& updated_apps,
const std::vector<std::string>& removed_apps,
const std::vector<std::string>& inserted_apps) override;
private:
DISALLOW_COPY_AND_ASSIGN(LauncherCrostiniAppUpdater);
};
#endif // CHROME_BROWSER_UI_ASH_LAUNCHER_LAUNCHER_CROSTINI_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