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

Unified Diff: chrome/browser/chromeos/app_mode/arc/arc_kiosk_app_service.cc

Issue 2649103006: arc: Add splash screen for ARC++ Kiosk startup (Closed)
Patch Set: achuithb@ comments Created 3 years, 10 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/chromeos/app_mode/arc/arc_kiosk_app_service.cc
diff --git a/chrome/browser/chromeos/app_mode/arc/arc_kiosk_app_service.cc b/chrome/browser/chromeos/app_mode/arc/arc_kiosk_app_service.cc
index 826b62768de907da5a892d9e4a2e7d6cee8589ee..b84c394e7bf77b03179a8af3e98923ff09c17d61 100644
--- a/chrome/browser/chromeos/app_mode/arc/arc_kiosk_app_service.cc
+++ b/chrome/browser/chromeos/app_mode/arc/arc_kiosk_app_service.cc
@@ -51,6 +51,10 @@ ArcKioskAppService* ArcKioskAppService::Get(content::BrowserContext* context) {
return ArcKioskAppServiceFactory::GetForBrowserContext(context);
}
+void ArcKioskAppService::SetDelegate(Delegate* delegate) {
+ delegate_ = delegate;
+}
+
void ArcKioskAppService::Shutdown() {
ArcAppListPrefs::Get(profile_)->RemoveObserver(this);
app_manager_->RemoveObserver(this);
@@ -59,10 +63,14 @@ void ArcKioskAppService::Shutdown() {
void ArcKioskAppService::OnAppRegistered(
const std::string& app_id,
const ArcAppListPrefs::AppInfo& app_info) {
+ if (!app_id_.empty() && app_id != app_id_)
+ return;
PreconditionsChanged();
}
void ArcKioskAppService::OnAppReadyChanged(const std::string& id, bool ready) {
+ if (!app_id_.empty() && id != app_id_)
+ return;
PreconditionsChanged();
}
@@ -83,6 +91,8 @@ void ArcKioskAppService::OnTaskCreated(int32_t task_id,
if (app_info_ && package_name == app_info_->package_name &&
activity == app_info_->activity) {
task_id_ = task_id;
+ if (delegate_)
+ delegate_->OnAppStarted();
}
}
@@ -106,6 +116,11 @@ void ArcKioskAppService::OnMaintenanceSessionFinished() {
PreconditionsChanged();
}
+void ArcKioskAppService::OnAppWindowLaunched() {
+ if (delegate_)
+ delegate_->OnAppWindowLaunched();
+}
+
ArcKioskAppService::ArcKioskAppService(Profile* profile) : profile_(profile) {
ArcAppListPrefs::Get(profile_)->AddObserver(this);
app_manager_ = ArcKioskAppManager::Get();
@@ -133,8 +148,8 @@ void ArcKioskAppService::PreconditionsChanged() {
profile_->GetPrefs()->GetBoolean(prefs::kArcPolicyCompliant) &&
!maintenance_session_running_) {
if (!app_launcher_)
- app_launcher_.reset(new ArcKioskAppLauncher(
- profile_, ArcAppListPrefs::Get(profile_), app_id_));
+ app_launcher_ = base::MakeUnique<ArcKioskAppLauncher>(
+ profile_, ArcAppListPrefs::Get(profile_), app_id_, this);
} else if (task_id_ != -1) {
arc::CloseTask(task_id_);
}

Powered by Google App Engine
This is Rietveld 408576698