summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormnissler@chromium.org <mnissler@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-05-07 19:07:59 +0000
committermnissler@chromium.org <mnissler@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-05-07 19:07:59 +0000
commit06a410aee2ef4333f7fecc2cc697434cf872309a (patch)
treedaff88424fc28df929bc3a6c9bbaf7e5f4d54540
parent3fb01c2120c337ecb69f82d378493236ad639f59 (diff)
downloadchromium_src-06a410aee2ef4333f7fecc2cc697434cf872309a.zip
chromium_src-06a410aee2ef4333f7fecc2cc697434cf872309a.tar.gz
chromium_src-06a410aee2ef4333f7fecc2cc697434cf872309a.tar.bz2
Wire up device policy for pinned launcher apps in retail mode.
BUG=chromium-os:29917 TEST=Configure pinned apps device policy in retail mode, check that launcher shows configured apps (those need to be installed!). Review URL: https://chromiumcodereview.appspot.com/10384036 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@135690 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/policy/device_policy_cache.cc21
-rw-r--r--chrome/browser/policy/device_policy_cache.h3
-rw-r--r--chrome/browser/policy/proto/chrome_device_policy.proto9
3 files changed, 30 insertions, 3 deletions
diff --git a/chrome/browser/policy/device_policy_cache.cc b/chrome/browser/policy/device_policy_cache.cc
index aada619..300b952 100644
--- a/chrome/browser/policy/device_policy_cache.cc
+++ b/chrome/browser/policy/device_policy_cache.cc
@@ -352,7 +352,7 @@ void DevicePolicyCache::DecodeDevicePolicy(
PolicyMap* policies) {
// Decode the various groups of policies.
DecodeLoginPolicies(policy, policies);
- DecodeKioskPolicies(policy, policies);
+ DecodeKioskPolicies(policy, policies, install_attributes_);
DecodeNetworkPolicies(policy, policies, install_attributes_);
DecodeReportingPolicies(policy, policies);
DecodeGenericPolicies(policy, policies);
@@ -425,7 +425,12 @@ void DevicePolicyCache::DecodeLoginPolicies(
// static
void DevicePolicyCache::DecodeKioskPolicies(
const em::ChromeDeviceSettingsProto& policy,
- PolicyMap* policies) {
+ PolicyMap* policies,
+ EnterpriseInstallAttributes* install_attributes) {
+ // No policies if this is not KIOSK.
+ if (install_attributes->GetMode() != DEVICE_MODE_KIOSK)
+ return;
+
if (policy.has_forced_logout_timeouts()) {
const em::ForcedLogoutTimeoutsProto& container(
policy.forced_logout_timeouts());
@@ -479,6 +484,18 @@ void DevicePolicyCache::DecodeKioskPolicies(
POLICY_SCOPE_MACHINE,
app_pack_list);
}
+
+ if (policy.has_pinned_apps()) {
+ const em::PinnedAppsProto& container(policy.pinned_apps());
+ base::ListValue* pinned_apps_list = new base::ListValue();
+ for (int i = 0; i < container.app_id_size(); ++i)
+ pinned_apps_list->Append(Value::CreateStringValue(container.app_id(i)));
+
+ policies->Set(key::kPinnedLauncherApps,
+ POLICY_LEVEL_RECOMMENDED,
+ POLICY_SCOPE_MACHINE,
+ pinned_apps_list);
+ }
}
// static
diff --git a/chrome/browser/policy/device_policy_cache.h b/chrome/browser/policy/device_policy_cache.h
index 1c38167..c396a9f 100644
--- a/chrome/browser/policy/device_policy_cache.h
+++ b/chrome/browser/policy/device_policy_cache.h
@@ -89,7 +89,8 @@ class DevicePolicyCache : public CloudPolicyCacheBase {
PolicyMap* policies);
static void DecodeKioskPolicies(
const enterprise_management::ChromeDeviceSettingsProto& policy,
- PolicyMap* policies);
+ PolicyMap* policies,
+ EnterpriseInstallAttributes* install_attributes);
static void DecodeNetworkPolicies(
const enterprise_management::ChromeDeviceSettingsProto& policy,
PolicyMap* policies,
diff --git a/chrome/browser/policy/proto/chrome_device_policy.proto b/chrome/browser/policy/proto/chrome_device_policy.proto
index b899812..17a1743c 100644
--- a/chrome/browser/policy/proto/chrome_device_policy.proto
+++ b/chrome/browser/policy/proto/chrome_device_policy.proto
@@ -114,6 +114,14 @@ message AppPackProto {
repeated AppPackEntryProto app_pack = 1;
}
+// This is a special policy for kiosk/retail mode that specifies what apps
+// should be pinned to the launcher. For regular accounts, pinned apps are
+// controlled through user policy.
+message PinnedAppsProto {
+ // App IDs for the apps to pin.
+ repeated string app_id = 1;
+}
+
message ForcedLogoutTimeoutsProto {
// All timeouts are specified in milliseconds.
@@ -201,4 +209,5 @@ message ChromeDeviceSettingsProto {
optional ScreenSaverProto login_screen_saver = 16;
optional AutoUpdateSettingsProto auto_update_settings = 17;
optional StartUpUrlsProto start_up_urls = 18;
+ optional PinnedAppsProto pinned_apps = 19;
}