Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(25)

Unified Diff: chrome/browser/ui/app_list/arc/arc_app_list_prefs.cc

Issue 2807483002: [Merge M58] arg: Make shortcuts runnable in deferred mode. (Closed)
Patch Set: Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 77f2a4f46ad566cae862079e7bd3ee994eec19b3..316ea7ac9f1cb3d3d8dfda5f1e6f22025370cc22 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
@@ -586,10 +586,8 @@ void ArcAppListPrefs::SetLastLaunchTime(const std::string& app_id,
void ArcAppListPrefs::DisableAllApps() {
std::unordered_set<std::string> old_ready_apps;
old_ready_apps.swap(ready_apps_);
- for (auto& app_id : old_ready_apps) {
- for (auto& observer : observer_list_)
- observer.OnAppReadyChanged(app_id, false);
- }
+ for (auto& app_id : old_ready_apps)
+ NotifyAppReadyChanged(app_id, false);
}
void ArcAppListPrefs::NotifyRegisteredApps() {
@@ -623,8 +621,7 @@ void ArcAppListPrefs::RemoveAllApps() {
} else {
if (ready_apps_.count(app_id)) {
ready_apps_.erase(app_id);
- for (auto& observer : observer_list_)
- observer.OnAppReadyChanged(app_id, false);
+ NotifyAppReadyChanged(app_id, false);
}
}
}
@@ -822,10 +819,8 @@ void ArcAppListPrefs::AddAppAndShortcut(
ready_apps_.insert(app_id);
if (was_tracked) {
- if (was_disabled && app_ready) {
- for (auto& observer : observer_list_)
- observer.OnAppReadyChanged(app_id, true);
- }
+ if (was_disabled && app_ready)
+ NotifyAppReadyChanged(app_id, true);
} else {
AppInfo app_info(updated_name, package_name, activity, intent_uri,
icon_resource_id, base::Time(), GetInstallTime(app_id),
@@ -960,6 +955,7 @@ void ArcAppListPrefs::OnAppListRefreshed(
if (IsShortcut(app_id)) {
// If this is a shortcut, we just mark it as ready.
ready_apps_.insert(app_id);
+ NotifyAppReadyChanged(app_id, true);
} else {
// Default apps may not be installed yet at this moment.
if (!default_apps_.HasApp(app_id))
@@ -1371,6 +1367,12 @@ void ArcAppListPrefs::OnInstallationFinished(
--installing_packages_count_;
}
+void ArcAppListPrefs::NotifyAppReadyChanged(const std::string& app_id,
+ bool ready) {
+ for (auto& observer : observer_list_)
+ observer.OnAppReadyChanged(app_id, ready);
+}
+
ArcAppListPrefs::AppInfo::AppInfo(const std::string& name,
const std::string& package_name,
const std::string& activity,
« no previous file with comments | « chrome/browser/ui/app_list/arc/arc_app_list_prefs.h ('k') | chrome/browser/ui/app_list/arc/arc_app_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698