| Index: chrome/browser/ui/app_list/arc/arc_app_list_prefs.cc
|
| diff --git a/chrome/browser/ui/app_list/arc/arc_app_list_prefs.cc b/chrome/browser/ui/app_list/arc/arc_app_list_prefs.cc
|
| index 374344a90ce8884a58810d63a92f9e890f2eca3c..3829b002a47cd9aa8fb08049c6e23b1bf442875f 100644
|
| --- a/chrome/browser/ui/app_list/arc/arc_app_list_prefs.cc
|
| +++ b/chrome/browser/ui/app_list/arc/arc_app_list_prefs.cc
|
| @@ -563,11 +563,13 @@
|
| NOTREACHED();
|
| continue;
|
| }
|
| +
|
| // Default apps are reported earlier.
|
| - if (default_apps_.HasApp(app_id))
|
| - continue;
|
| - for (auto& observer : observer_list_)
|
| - observer.OnAppRegistered(app_id, *app_info);
|
| + if (!tracked_apps_.count(app_id)) {
|
| + for (auto& observer : observer_list_)
|
| + observer.OnAppRegistered(app_id, *app_info);
|
| + tracked_apps_.insert(app_id);
|
| + }
|
| }
|
|
|
| apps_restored_ = true;
|
| @@ -722,8 +724,8 @@
|
| if (app_id == arc::kPlayStoreAppId)
|
| updated_name = l10n_util::GetStringUTF8(IDS_ARC_PLAYSTORE_ICON_TITLE_BETA);
|
|
|
| - const bool was_registered = IsRegistered(app_id);
|
| - if (was_registered) {
|
| + const bool was_tracked = tracked_apps_.count(app_id);
|
| + if (was_tracked) {
|
| std::unique_ptr<ArcAppListPrefs::AppInfo> app_old_info = GetApp(app_id);
|
| DCHECK(app_old_info);
|
| DCHECK(launchable);
|
| @@ -759,7 +761,7 @@
|
| if (was_disabled && app_ready)
|
| ready_apps_.insert(app_id);
|
|
|
| - if (was_registered) {
|
| + if (was_tracked) {
|
| if (was_disabled && app_ready) {
|
| for (auto& observer : observer_list_)
|
| observer.OnAppReadyChanged(app_id, true);
|
| @@ -772,6 +774,7 @@
|
| launchable, orientation_lock);
|
| for (auto& observer : observer_list_)
|
| observer.OnAppRegistered(app_id, app_info);
|
| + tracked_apps_.insert(app_id);
|
| }
|
|
|
| if (app_ready) {
|
| @@ -814,8 +817,10 @@
|
| const bool removed = apps->Remove(app_id, nullptr);
|
| DCHECK(removed);
|
|
|
| + DCHECK(tracked_apps_.count(app_id));
|
| for (auto& observer : observer_list_)
|
| observer.OnAppRemoved(app_id);
|
| + tracked_apps_.erase(app_id);
|
|
|
| // Remove local data on file system.
|
| content::BrowserThread::GetBlockingPool()->PostTask(
|
|
|