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

Unified Diff: chrome/browser/policy/enterprise_install_attributes.h

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/enterprise_install_attributes.h
diff --git a/chrome/browser/policy/enterprise_install_attributes.h b/chrome/browser/policy/enterprise_install_attributes.h
index 90d728a277d48dbabe7c64f767c1ae40dc5ca84e..34fb5769d127a7b86332a602b35719e554d6b0c7 100644
--- a/chrome/browser/policy/enterprise_install_attributes.h
+++ b/chrome/browser/policy/enterprise_install_attributes.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -10,6 +10,7 @@
#include "base/basictypes.h"
#include "base/compiler_specific.h"
+#include "chrome/browser/policy/proto/device_management_backend.pb.h"
namespace chromeos {
class CryptohomeLibrary;
@@ -29,12 +30,22 @@ class EnterpriseInstallAttributes {
LOCK_WRONG_USER,
};
Mattias Nissler (ping if slow) 2012/02/16 10:36:27 comment
pastarmovj 2012/02/17 13:59:47 Done.
+ enum DeviceMode {
+ END_USER_DEVICE,
Mattias Nissler (ping if slow) 2012/02/16 10:36:27 Put a common prefix, e.g. DEVICE_MODE_ENTERPRISE e
Mattias Nissler (ping if slow) 2012/02/16 10:36:27 s/END_USER/CONSUMER/, since enterprise users are a
pastarmovj 2012/02/17 13:59:47 Done.
pastarmovj 2012/02/17 13:59:47 Done.
+ ENTERPRISE_DEVICE,
+ KIOSK_DEVICE,
+ UNKNOWN_DEVICE
+ };
+
explicit EnterpriseInstallAttributes(chromeos::CryptohomeLibrary* cryptohome);
// Locks the device to be an enterprise device registered by the given user.
// This can also be called after the lock has already been taken, in which
// case it checks that the passed user agrees with the locked attribute.
- LockResult LockDevice(const std::string& user) WARN_UNUSED_RESULT;
+ LockResult LockDevice(
Mattias Nissler (ping if slow) 2012/02/16 10:36:27 this line break should no longer be necessary
pastarmovj 2012/02/17 13:59:47 Done.
+ const std::string& user,
+ DeviceMode device_mode,
+ const std::string& device_id) WARN_UNUSED_RESULT;
// Checks whether this is an enterprise device.
bool IsEnterpriseDevice();
@@ -47,6 +58,16 @@ class EnterpriseInstallAttributes {
// device is not an enterprise device.
std::string GetRegistrationUser();
+ // Gets the device id that was generated when the device was registered.
+ // Returns an empty string if the device is not an enterprise device or the
+ // device id was not stored in the lockbox (prior to R19).
+ std::string GetDeviceId();
+
+ // Gets the mode the device was enrolled to. The return value only makes sense
+ // for enrolled devices. Always verify with |IsEnrolledDevice| before trusting
+ // the output of this function!
Mattias Nissler (ping if slow) 2012/02/16 10:36:27 This comment is outdated, you may want to change i
pastarmovj 2012/02/17 13:59:47 Done. Actually for non-enterprise devices it will
+ DeviceMode GetMode();
+
private:
// Makes sure the local caches for enterprise-related install attributes are
// up-to-date with what cryptohome has.
@@ -56,6 +77,9 @@ class EnterpriseInstallAttributes {
bool device_locked_;
std::string registration_user_;
+ std::string registration_domain_;
+ std::string registration_device_id_;
+ DeviceMode registration_mode_;
DISALLOW_COPY_AND_ASSIGN(EnterpriseInstallAttributes);
};

Powered by Google App Engine
This is Rietveld 408576698