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

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: Address lhchavez@ comments. 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 1317d0921e9d8d00628170b1ba5b88ad52db1903..559047b0d0ffb0b89c61490673b58008c7e1686a 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) {
@@ -665,6 +666,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_);
Luis Héctor Chávez 2016/11/16 17:48:46 Also mention that this launches the kiosk app.
Sergey Poromov 2016/11/16 18:03:20 It's mentioned in header file and as well comment
+ DCHECK(kiosk_app_service_);
+ }
+
// In some tests app_instance may not be set.
if (!app_instance)
return;
@@ -684,6 +691,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