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

Unified Diff: chrome/browser/policy/device_token_fetcher.cc

Issue 9403010: Add support for kiosk mode on the client. Make sure the settings are written in the lockbox. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed comments and added more tests. Created 8 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/policy/device_token_fetcher.cc
diff --git a/chrome/browser/policy/device_token_fetcher.cc b/chrome/browser/policy/device_token_fetcher.cc
index 3faf3e1a5b61b3045349f3dcfe45a413c735ac62..c98df5688502f5cd0745e51027b61450466a1944 100644
--- a/chrome/browser/policy/device_token_fetcher.cc
+++ b/chrome/browser/policy/device_token_fetcher.cc
@@ -14,6 +14,7 @@
#include "chrome/browser/policy/cloud_policy_data_store.h"
#include "chrome/browser/policy/delayed_work_scheduler.h"
#include "chrome/browser/policy/device_management_service.h"
+#include "chrome/browser/policy/enterprise_install_attributes.h"
#include "chrome/browser/policy/enterprise_metrics.h"
#include "chrome/browser/policy/policy_notifier.h"
#include "chrome/browser/policy/proto/device_management_local.pb.h"
@@ -187,6 +188,24 @@ void DeviceTokenFetcher::OnTokenFetchCompleted(
if (register_response.has_device_management_token()) {
UMA_HISTOGRAM_ENUMERATION(kMetricToken, kMetricTokenFetchOK,
kMetricTokenSize);
+ if (register_response.has_enrollment_type()) {
+ switch (register_response.enrollment_type()) {
+ case em::DeviceRegisterResponse::ENTERPRISE:
+ data_store_->set_device_mode(
+ EnterpriseInstallAttributes::ENTERPRISE_DEVICE);
+ break;
+ case em::DeviceRegisterResponse::KIOSK:
+ data_store_->set_device_mode(
+ EnterpriseInstallAttributes::KIOSK_DEVICE);
+ break;
+ }
Mattias Nissler (ping if slow) 2012/02/16 10:36:27 we should do the right thing when there is a value
pastarmovj 2012/02/17 13:59:47 Done.
+ } else {
+ // If this field is not present we should assume we are running
+ // against old DMServer and go in enterprise enrollment mode.
+ data_store_->set_device_mode(
+ EnterpriseInstallAttributes::ENTERPRISE_DEVICE);
+ }
+
data_store_->SetDeviceToken(register_response.device_management_token(),
false);
SetState(STATE_TOKEN_AVAILABLE);

Powered by Google App Engine
This is Rietveld 408576698