Index: chrome/browser/ui/app_list/arc/arc_app_list_prefs.h |
diff --git a/chrome/browser/ui/app_list/arc/arc_app_list_prefs.h b/chrome/browser/ui/app_list/arc/arc_app_list_prefs.h |
index 4d48e18a793bb0503e5ba130a5069bfa8b5ec959..88dc508a1214be56a88019c0d2dfafd7980e8f9d 100644 |
--- a/chrome/browser/ui/app_list/arc/arc_app_list_prefs.h |
+++ b/chrome/browser/ui/app_list/arc/arc_app_list_prefs.h |
@@ -19,6 +19,7 @@ |
#include "base/observer_list.h" |
#include "base/optional.h" |
#include "base/time/time.h" |
+#include "base/timer/timer.h" |
#include "chrome/browser/chromeos/arc/arc_session_manager.h" |
#include "chrome/browser/ui/app_list/arc/arc_default_app_list.h" |
#include "components/arc/common/app.mojom.h" |
@@ -244,6 +245,7 @@ class ArcAppListPrefs |
const std::string& package_name) const; |
void SetDefaltAppsReadyCallback(base::Closure callback); |
+ void SimulateDefaultAppAvailabilityTimeoutForTesting(); |
private: |
friend class ChromeLauncherControllerImplTest; |
@@ -289,8 +291,10 @@ class ArcAppListPrefs |
int32_t task_id, |
const arc::mojom::OrientationLock orientation_lock) override; |
Luis Héctor Chávez
2017/01/03 19:08:00
nit: remove this blank line to indicate that these
khmel
2017/01/03 21:40:56
Done.
|
- void OnInstallationStarted() override; |
- void OnInstallationFinished() override; |
+ void OnInstallationStarted( |
+ const base::Optional<std::string>& package_name) override; |
+ void OnInstallationFinished( |
+ const base::Optional<std::string>& package_name, bool success) override; |
void StartPrefs(); |
@@ -356,6 +360,17 @@ class ArcAppListPrefs |
// and it is not scheduled to install by sync. |
bool IsUnknownPackage(const std::string& package_name) const; |
+ // Validates that default apps either exist or installation session is |
+ // started. |
+ void ValidateDefaultAppaAvailability(); |
Luis Héctor Chávez
2017/01/03 19:08:00
nit: s/AppaAvailability/AppAvailability/
khmel
2017/01/03 21:40:56
Done.
|
+ |
+ // Performs data clean up for removed package. |
+ void HandlePackageRemoved(const std::string& package_name); |
+ |
+ // Sets timeout to wait for default app installed or installation started if |
+ // some default app is not available yet. |
+ void MaybeSetDefaultAppLoadingTimeout(); |
+ |
Profile* const profile_; |
// Owned by the BrowserContext. |
@@ -384,6 +399,13 @@ class ArcAppListPrefs |
bool apps_restored_ = false; |
// True is Arc package list has been refreshed once. |
bool package_list_initial_refreshed_ = false; |
+ // Play Store does not have publicly available observers for default app |
+ // installations. This timeout is for validating default app availability. |
+ // Default apps should be either already installed or their installations |
+ // should be started soon after initial app list refresh. |
+ base::OneShotTimer validate_default_app_availability_timeout_; |
+ // Set of currently installing default apps_. |
+ std::unordered_set<std::string> default_apps_installations_; |
arc::ArcPackageSyncableService* sync_service_ = nullptr; |