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

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

Issue 2496903003: arc: Add Arc Kiosk app service and ability to launch kiosk apps. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@policy_comp_parse
Patch Set: rebase Created 4 years, 1 month 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 db313d1ef53ddbad13f1b1c0bdc126f581c85d29..071302348686452f2ae42ae7eb4b78ddbe87043e 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
@@ -12,6 +12,7 @@
#include "base/metrics/histogram_macros.h"
#include "base/strings/string_number_conversions.h"
#include "base/task_runner_util.h"
+#include "chrome/browser/chromeos/app_mode/arc/arc_kiosk_app_service.h"
#include "chrome/browser/chromeos/arc/policy/arc_policy_util.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/app_list/app_list_service.h"
@@ -24,6 +25,7 @@
#include "components/crx_file/id_util.h"
#include "components/pref_registry/pref_registry_syncable.h"
#include "components/prefs/scoped_user_pref_update.h"
+#include "components/user_manager/user_manager.h"
#include "content/public/browser/browser_thread.h"
#include "ui/base/l10n/l10n_util.h"
@@ -230,7 +232,6 @@ ArcAppListPrefs::ArcAppListPrefs(
: profile_(profile),
prefs_(profile->GetPrefs()),
app_instance_holder_(app_instance_holder),
- sync_service_(nullptr),
binding_(this),
default_apps_(this, profile),
weak_ptr_factory_(this) {
@@ -667,6 +668,12 @@ void ArcAppListPrefs::OnInstanceReady() {
sync_service_ = arc::ArcPackageSyncableService::Get(profile_);
DCHECK(sync_service_);
+ // Kiosk apps should be run only for kiosk sessions.
+ if (user_manager::UserManager::Get()->IsLoggedInAsArcKioskApp()) {
+ kiosk_app_service_ = chromeos::ArcKioskAppService::Get(profile_);
+ DCHECK(kiosk_app_service_);
+ }
+
// In some tests app_instance may not be set.
if (!app_instance)
return;
@@ -686,6 +693,7 @@ void ArcAppListPrefs::OnInstanceClosed() {
sync_service_ = nullptr;
}
+ kiosk_app_service_ = nullptr;
is_initialized_ = false;
package_list_initial_refreshed_ = false;
}

Powered by Google App Engine
This is Rietveld 408576698