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

Unified Diff: chrome/browser/chromeos/policy/device_local_account.h

Issue 14927015: Translate device-local account IDs to user IDs (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix forward declaration. Created 7 years, 7 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/chromeos/policy/device_local_account.h
diff --git a/chrome/browser/chromeos/policy/device_local_account.h b/chrome/browser/chromeos/policy/device_local_account.h
new file mode 100644
index 0000000000000000000000000000000000000000..6d1896eee1e5ba10de972d2fe88ffd94cdab84d7
--- /dev/null
+++ b/chrome/browser/chromeos/policy/device_local_account.h
@@ -0,0 +1,60 @@
+// Copyright (c) 2013 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.
+
+#ifndef CHROME_BROWSER_CHROMEOS_POLICY_DEVICE_LOCAL_ACCOUNT_H_
+#define CHROME_BROWSER_CHROMEOS_POLICY_DEVICE_LOCAL_ACCOUNT_H_
+
+#include <string>
+#include <vector>
+
+namespace chromeos {
+class CrosSettings;
+}
+
+namespace policy {
+
+// This must match DeviceLocalAccountInfoProto.AccountType in
+// chrome_device_policy.proto.
+struct DeviceLocalAccount {
+ enum Type {
+ // A login-less, policy-configured browsing session.
+ TYPE_PUBLIC_SESSION,
+ // An account that serves as a container for a single full-screen app.
+ TYPE_KIOSK_APP,
+ // Sentinel, must be last.
+ TYPE_COUNT
+ };
+
+ DeviceLocalAccount(Type type,
+ const std::string& account_id,
+ const std::string& kiosk_app_id,
+ const std::string& kiosk_app_update_url);
+ ~DeviceLocalAccount();
+
+ Type type;
+ std::string account_id;
+ std::string user_id;
+ std::string kiosk_app_id;
+ std::string kiosk_app_update_url;
+};
+
+std::string GenerateDeviceLocalAccountUserId(const std::string& account_id,
+ DeviceLocalAccount::Type type);
+
+bool IsKioskAppUser(const std::string& user_id);
+
+// Stores a list of device-local accounts in |cros_settings|. The accounts are
+// stored as a list of dictionaries with each dictionary containing the
+// information about one |DeviceLocalAccount|.
+void SetDeviceLocalAccounts(
+ chromeos::CrosSettings* cros_settings,
+ const std::vector<DeviceLocalAccount>& accounts);
+
+// Retrieves a list of device-local accounts from |cros_settings|.
+std::vector<DeviceLocalAccount> GetDeviceLocalAccounts(
+ chromeos::CrosSettings* cros_settings);
+
+} // namespace policy
+
+#endif // CHROME_BROWSER_CHROMEOS_POLICY_DEVICE_LOCAL_ACCOUNT_H_
« no previous file with comments | « chrome/browser/chromeos/login/wizard_controller.cc ('k') | chrome/browser/chromeos/policy/device_local_account.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698